Ejemplo n.º 1
0
static int zd_mac_tx(struct zd_mac *mac, struct ieee80211_txb *txb, int pri)
{
	int i, r;
	struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);

	for (i = 0; i < txb->nr_frags; i++) {
		struct sk_buff *skb = txb->fragments[i];

		r = fill_ctrlset(mac, txb, i);
		if (r) {
			ieee->stats.tx_dropped++;
			return r;
		}
		r = zd_usb_tx(&mac->chip.usb, skb->data, skb->len);
		if (r) {
			ieee->stats.tx_dropped++;
			return r;
		}
	}

	/* FIXME: shouldn't this be handled by the upper layers? */
	mac->netdev->trans_start = jiffies;

	ieee80211_txb_free(txb);
	return 0;
}
Ejemplo n.º 2
0
/**
 * zd_op_tx - transmits a network frame to the device
 *
 * @dev: mac80211 hardware device
 * @skb: socket buffer
 * @control: the control structure
 *
 * This function transmit an IEEE 802.11 network frame to the device. The
 * control block of the skbuff will be initialized. If necessary the incoming
 * mac80211 queues will be stopped.
 */
static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
		     struct ieee80211_tx_control *control)
{
	struct zd_mac *mac = zd_hw_mac(hw);
	int r;

	r = fill_ctrlset(mac, skb, control);
	if (r)
		return r;

	r = init_tx_skb_control_block(skb, hw, control);
	if (r)
		return r;
	r = zd_usb_tx(&mac->chip.usb, skb);
	if (r) {
		clear_tx_skb_control_block(skb);
		return r;
	}
	return 0;
}