Search Linux Wireless

Re: [PATCH 4/4] mac80211: transmit fragment list to drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> --- a/include/net/mac80211.h    2011-11-16 15:19:31.000000000 +0100
> +++ b/include/net/mac80211.h    2011-11-16 15:20:03.000000000 +0100
> @@ -1760,11 +1760,20 @@ enum ieee80211_frame_release_type {
>  *     skb contains the buffer starting from the IEEE 802.11 header.
>  *     The low-level driver should send the frame out based on
>  *     configuration in the TX control data. This handler should,
> - *     preferably, never fail and stop queues appropriately, more
> - *     importantly, however, it must never fail for A-MPDU-queues.
> - *     This function should return NETDEV_TX_OK except in very
> - *     limited cases.
> - *     Must be implemented and atomic.
> + *     preferably, never fail and stop queues appropriately.
> + *     This needs only be implemented if @tx_frags is set to the
> + *     ieee80211_generic_tx_frags handler.
> + *     Must be atomic.
> + *
> + * @tx_frags: Called to transmit multiple fragments of a single MSDU.
> + *     This handler must consume all fragments, sending out some of
> + *     them only is useless and it can't ask for some of them to be
> + *     queued again. If the frame is not fragmented the queue has a
> + *     single SKB only.
> + *     If this is called, the tx_info @vif and @sta pointer will be
> + *     invalid -- you must not use them in that case.
> + *     Must be implemented and atomic. If the driver implements @tx
> + *     only then this must be set to ieee80211_generic_tx_frags().

<..snip..>

> --- a/net/mac80211/driver-ops.h 2011-11-16 15:19:31.000000000 +0100
> +++ b/net/mac80211/driver-ops.h 2011-11-16 15:20:03.000000000 +0100
> @@ -15,6 +15,18 @@ static inline void drv_tx(struct ieee802
>        local->ops->tx(&local->hw, skb);
>  }
>
> +static inline void drv_tx_frags(struct ieee80211_local *local,
> +                               struct ieee80211_sub_if_data *sdata,
> +                               struct sta_info *sta,
> +                               struct sk_buff_head *skbs,
> +                               void *internal)
> +{
> +       local->ops->tx_frags(&local->hw,
> +                            sdata ? &sdata->vif : NULL,
> +                            sta ? &sta->sta : NULL,
> +                            skbs, internal);
> +}

Instead of changing every driver and making .tx_frags callback mandatory,
isn't it easier to have a if-else here?
Then it is much easier for the drivers as you can document that either
.tx or .tx_frags is mandatory but never both.

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux