 return 0; 
 return 0; 
static int start_tx (struct sk_buff *skb, struct net_device *dev){	struct atmel_private *priv = netdev_priv(dev);	struct ieee80211_hdr_4addr header;	unsigned long flags;	u16 buff, frame_ctl, len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN;	u8 SNAP_RFC1024[6] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; 	if (priv->card && priv->present_callback && 	    !(*priv->present_callback)(priv->card)) {		priv->stats.tx_errors++;		dev_kfree_skb(skb);		return 0;	}		if (priv->station_state != STATION_STATE_READY) {		priv->stats.tx_errors++;		dev_kfree_skb(skb);		return 0;	}		/* first ensure the timer func cannot run */	spin_lock_bh(&priv->timerlock); 	/* then stop the hardware ISR */	spin_lock_irqsave(&priv->irqlock, flags); 	/* nb doing the above in the opposite order will deadlock */		/* The Wireless Header is 30 bytes. In the Ethernet packet we "cut" the	   12 first bytes (containing DA/SA) and put them in the appropriate fields of	   the Wireless Header. Thus the packet length is then the initial + 18 (+30-12) */		if (!(buff = find_tx_buff(priv, len + 18))) {		priv->stats.tx_dropped++;		spin_unlock_irqrestore(&priv->irqlock, flags);		spin_unlock_bh(&priv->timerlock);		netif_stop_queue(dev);		return 1;	}		frame_ctl = IEEE80211_FTYPE_DATA;	header.duration_id = 0;	header.seq_ctl = 0;	if (priv->wep_is_on)		frame_ctl |= IEEE80211_FCTL_PROTECTED;	if (priv->operating_mode == IW_MODE_ADHOC) {		memcpy(&header.addr1, skb->data, 6);		memcpy(&header.addr2, dev->dev_addr, 6);		memcpy(&header.addr3, priv->BSSID, 6);	} else {		frame_ctl |= IEEE80211_FCTL_TODS;		memcpy(&header.addr1, priv->CurrentBSSID, 6);		memcpy(&header.addr2, dev->dev_addr, 6);		memcpy(&header.addr3, skb->data, 6);	}		if (priv->use_wpa)		memcpy(&header.addr4, SNAP_RFC1024, 6);	header.frame_ctl = cpu_to_le16(frame_ctl);	/* Copy the wireless header into the card */	atmel_copy_to_card(dev, buff, (unsigned char *)&header, DATA_FRAME_WS_HEADER_SIZE);	/* Copy the packet sans its 802.3 header addresses which have been replaced */	atmel_copy_to_card(dev, buff + DATA_FRAME_WS_HEADER_SIZE, skb->data + 12, len - 12);	priv->tx_buff_tail += len - 12 + DATA_FRAME_WS_HEADER_SIZE;		/* low bit of first byte of destination tells us if broadcast */	tx_update_descriptor(priv, *(skb->data) & 0x01, len + 18, buff, TX_PACKET_TYPE_DATA);	dev->trans_start = jiffies;	priv->stats.tx_bytes += len;		spin_unlock_irqrestore(&priv->irqlock, flags);	spin_unlock_bh(&priv->timerlock);	dev_kfree_skb(skb);		return 0;	}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c