prism2_tx_cb, (void *) buf_len)) { 
prism2_tx_cb, (long) buf_len)) { 
static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev){	struct hostap_interface *iface;	local_info_t *local;	struct hfa384x_tx_frame txdesc;	struct hostap_ieee80211_hdr *hdr;	struct hostap_skb_tx_data *meta;	int hdr_len, data_len, idx, res, ret = -1;	u16 tx_control, fc;	iface = netdev_priv(dev);	local = iface->local;	meta = (struct hostap_skb_tx_data *) skb->cb;	hdr = (struct hostap_ieee80211_hdr *) skb->data;	prism2_callback(local, PRISM2_CALLBACK_TX_START);	if ((local->func->card_present && !local->func->card_present(local)) ||	    !local->hw_ready || local->hw_downloading || local->pri_only) {		if (net_ratelimit()) {			printk(KERN_DEBUG "%s: prism2_tx_80211: hw not ready -"			       " skipping\n", dev->name);		}		goto fail;	}	memset(&txdesc, 0, sizeof(txdesc));	/* skb->data starts with txdesc->frame_control */	hdr_len = 24;	memcpy(&txdesc.frame_control, skb->data, hdr_len); 	fc = le16_to_cpu(txdesc.frame_control);	if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA &&	    (fc & WLAN_FC_FROMDS) && (fc & WLAN_FC_TODS) && skb->len >= 30) {		/* Addr4 */		memcpy(txdesc.addr4, skb->data + hdr_len, ETH_ALEN);		hdr_len += ETH_ALEN;	}	tx_control = local->tx_control;	if (meta->tx_cb_idx) {		tx_control |= HFA384X_TX_CTRL_TX_OK;		txdesc.sw_support = cpu_to_le16(meta->tx_cb_idx);	}	txdesc.tx_control = cpu_to_le16(tx_control);	txdesc.tx_rate = meta->rate;	data_len = skb->len - hdr_len;	txdesc.data_len = cpu_to_le16(data_len);	txdesc.len = cpu_to_be16(data_len);	idx = prism2_get_txfid_idx(local);	if (idx < 0)		goto fail;	if (local->frame_dump & PRISM2_DUMP_TX_HDR)		hostap_dump_tx_header(dev->name, &txdesc);	spin_lock(&local->baplock);	res = hfa384x_setup_bap(dev, BAP0, local->txfid[idx], 0);#if defined(PRISM2_PCI) && defined(PRISM2_BUS_MASTER)	if (!res && skb->len >= local->bus_master_threshold_tx) {		u8 *pos;		int buf_len;		local->bus_m0_tx_idx = idx;		/* FIX: BAP0 should be locked during bus master transfer, but		 * baplock with BH's disabled is not OK for this; netif queue		 * stopping is not enough since BAP0 is used also for RID		 * read/write */		/* stop the queue for the time that bus mastering on BAP0 is		 * in use */		netif_stop_queue(dev);		spin_unlock(&local->baplock);		/* Copy frame data to bus_m0_buf */		pos = local->bus_m0_buf;		memcpy(pos, &txdesc, sizeof(txdesc));		pos += sizeof(txdesc);		memcpy(pos, skb->data + hdr_len, skb->len - hdr_len);		pos += skb->len - hdr_len;		buf_len = pos - local->bus_m0_buf;		if (buf_len & 1)			buf_len++;#ifdef PRISM2_ENABLE_BEFORE_TX_BUS_MASTER		/* Any RX packet seems to break something with TX bus		 * mastering; enable command is enough to fix this.. */		if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_ENABLE, 0,					 prism2_tx_cb, (void *) buf_len)) {			printk(KERN_DEBUG "%s: TX: enable port0 failed\n",			       dev->name);		}#else /* PRISM2_ENABLE_BEFORE_TX_BUS_MASTER */		prism2_tx_cb(dev, (void *) buf_len, 0, 0);#endif /* PRISM2_ENABLE_BEFORE_TX_BUS_MASTER */		/* Bus master transfer will be started from command completion		 * event handler and TX handling will be finished by calling		 * prism2_transmit() from bus master event handler */		goto tx_stats;	}#endif /* PRISM2_PCI and PRISM2_BUS_MASTER */	if (!res)		res = hfa384x_to_bap(dev, BAP0, &txdesc, sizeof(txdesc));	if (!res)		res = hfa384x_to_bap(dev, BAP0, skb->data + hdr_len,				     skb->len - hdr_len);	spin_unlock(&local->baplock);	if (!res)		res = prism2_transmit(dev, idx);	if (res) {		printk(KERN_DEBUG "%s: prism2_tx_80211 - to BAP0 failed\n",		       dev->name);		local->intransmitfid[idx] = PRISM2_TXFID_EMPTY;		schedule_work(&local->reset_queue);		goto fail;	}	ret = 0;fail:	prism2_callback(local, PRISM2_CALLBACK_TX_END);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b15eff2632be3fcea68e01ba7f12e26a731e3157/hostap_hw.c/buggy/drivers/net/wireless/hostap/hostap_hw.c