mac80211: adjust patches based on upstream feedback

SVN-Revision: 18431
owl
Felix Fietkau 2009-11-15 22:05:03 +00:00
parent 46560d64a8
commit b01e1d4916
2 changed files with 15 additions and 32 deletions

View File

@ -1,37 +1,20 @@
--- a/include/net/mac80211.h --- a/include/net/mac80211.h
+++ b/include/net/mac80211.h +++ b/include/net/mac80211.h
@@ -386,14 +386,17 @@ struct ieee80211_tx_rate { @@ -390,10 +390,12 @@ struct ieee80211_tx_rate {
* @flags: transmit info flags, defined above
* @band: the band to transmit on (use for checking for races)
* @antenna_sel_tx: antenna to use, 0 for automatic diversity
+ * @driver_flags: flags for internal driver use
* @pad: padding, ignore
* @control: union for control data * @control: union for control data
* @status: union for status data * @status: union for status data
* @driver_data: array of driver_data pointers * @driver_data: array of driver_data pointers
- * @ampdu_ack_len: number of aggregated frames. - * @ampdu_ack_len: number of aggregated frames.
- * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
+ * @ampdu_ack_len: number of acked aggregated frames. + * @ampdu_ack_len: number of acked aggregated frames.
+ * relevant only if ieee80211_tx_status_ampdu was set. * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
* @ampdu_ack_map: block ack bit map for the aggregation. * @ampdu_ack_map: block ack bit map for the aggregation.
* relevant only if IEEE80211_TX_STATUS_AMPDU was set. * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
+ * @ampdu_len: number of aggregated frames. + * @ampdu_len: number of aggregated frames.
+ * relevant only if ieee80211_tx_status_ampdu was set. + * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
* @ack_signal: signal strength of the ACK frame * @ack_signal: signal strength of the ACK frame
*/ */
struct ieee80211_tx_info { struct ieee80211_tx_info {
@@ -403,8 +406,8 @@ struct ieee80211_tx_info { @@ -428,7 +430,8 @@ struct ieee80211_tx_info {
u8 antenna_sel_tx;
- /* 2 byte hole */
- u8 pad[2];
+ u8 driver_flags;
+ u8 pad;
union {
struct {
@@ -428,7 +431,8 @@ struct ieee80211_tx_info {
u8 ampdu_ack_len; u8 ampdu_ack_len;
u64 ampdu_ack_map; u64 ampdu_ack_map;
int ack_signal; int ack_signal;

View File

@ -52,7 +52,7 @@
- struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info); - struct ath_tx_info_priv *tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
- if (tx_info_priv && tx_info_priv->frame_type == ATH9K_INT_PAUSE && - if (tx_info_priv && tx_info_priv->frame_type == ATH9K_INT_PAUSE &&
+ if ((tx_info->driver_flags & ATH_TX_INFO_FRAME_TYPE_PAUSE) && + if ((tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_PAUSE) &&
aphy->state == ATH_WIPHY_PAUSING) { aphy->state == ATH_WIPHY_PAUSING) {
- if (!(info->flags & IEEE80211_TX_STAT_ACK)) { - if (!(info->flags & IEEE80211_TX_STAT_ACK)) {
+ if (!(tx_info->flags & IEEE80211_TX_STAT_ACK)) { + if (!(tx_info->flags & IEEE80211_TX_STAT_ACK)) {
@ -127,15 +127,15 @@
- tx_info->rate_driver_data[0] = tx_info_priv; - tx_info->rate_driver_data[0] = tx_info_priv;
- tx_info_priv->aphy = aphy; - tx_info_priv->aphy = aphy;
- tx_info_priv->frame_type = txctl->frame_type; - tx_info_priv->frame_type = txctl->frame_type;
+ tx_info->driver_flags = 0; + tx_info->pad[0] = 0;
+ switch (txctl->frame_type) { + switch (txctl->frame_type) {
+ case ATH9K_NOT_INTERNAL: + case ATH9K_NOT_INTERNAL:
+ break; + break;
+ case ATH9K_INT_PAUSE: + case ATH9K_INT_PAUSE:
+ tx_info->driver_flags |= ATH_TX_INFO_FRAME_TYPE_PAUSE; + tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_PAUSE;
+ /* fall through */ + /* fall through */
+ case ATH9K_INT_UNPAUSE: + case ATH9K_INT_UNPAUSE:
+ tx_info->driver_flags |= ATH_TX_INFO_FRAME_TYPE_INTERNAL; + tx_info->pad[0] |= ATH_TX_INFO_FRAME_TYPE_INTERNAL;
+ break; + break;
+ } + }
hdrlen = ieee80211_get_hdrlen_from_skb(skb); hdrlen = ieee80211_get_hdrlen_from_skb(skb);
@ -194,7 +194,7 @@
- if (frame_type == ATH9K_NOT_INTERNAL) - if (frame_type == ATH9K_NOT_INTERNAL)
- ieee80211_tx_status(hw, skb); - ieee80211_tx_status(hw, skb);
- else - else
+ if (unlikely(tx_info->driver_flags & ATH_TX_INFO_FRAME_TYPE_INTERNAL)) + if (unlikely(tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_INTERNAL))
ath9k_tx_status(hw, skb); ath9k_tx_status(hw, skb);
+ else + else
+ ieee80211_tx_status(hw, skb); + ieee80211_tx_status(hw, skb);
@ -226,7 +226,7 @@
- tx_info_priv->update_rc = update_rc; - tx_info_priv->update_rc = update_rc;
+ if (update_rc) + if (update_rc)
+ tx_info->driver_flags |= ATH_TX_INFO_UPDATE_RC; + tx_info->pad[0] |= ATH_TX_INFO_UPDATE_RC;
if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT)
tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
@ -239,10 +239,10 @@
- tx_info_priv->n_bad_frames = nbad; - tx_info_priv->n_bad_frames = nbad;
+ if (ds->ds_txstat.ts_flags & + if (ds->ds_txstat.ts_flags &
+ (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN)) + (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN))
+ tx_info->driver_flags |= ATH_TX_INFO_UNDERRUN; + tx_info->pad[0] |= ATH_TX_INFO_UNDERRUN;
+ if ((ds->ds_txstat.ts_status & ATH9K_TXERR_XRETRY) || + if ((ds->ds_txstat.ts_status & ATH9K_TXERR_XRETRY) ||
+ (ds->ds_txstat.ts_status & ATH9K_TXERR_FIFO)) + (ds->ds_txstat.ts_status & ATH9K_TXERR_FIFO))
+ tx_info->driver_flags |= ATH_TX_INFO_XRETRY; + tx_info->pad[0] |= ATH_TX_INFO_XRETRY;
+ tx_info->status.ampdu_len = bf->bf_nframes; + tx_info->status.ampdu_len = bf->bf_nframes;
+ tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad; + tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad;
} }
@ -414,7 +414,7 @@
if (!priv_sta || !ieee80211_is_data(fc) || if (!priv_sta || !ieee80211_is_data(fc) ||
- !tx_info_priv->update_rc) - !tx_info_priv->update_rc)
- goto exit; - goto exit;
+ !(tx_info->driver_flags & ATH_TX_INFO_UPDATE_RC)) + !(tx_info->pad[0] & ATH_TX_INFO_UPDATE_RC))
+ return; + return;
- if (tx_info_priv->tx.ts_status & ATH9K_TXERR_FILT) - if (tx_info_priv->tx.ts_status & ATH9K_TXERR_FILT)
@ -431,7 +431,7 @@
- if (tx_info_priv->tx.ts_flags & - if (tx_info_priv->tx.ts_flags &
- (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN) && - (ATH9K_TX_DATA_UNDERRUN | ATH9K_TX_DELIM_UNDERRUN) &&
- ((sc->sc_ah->tx_trig_level) >= ath_rc_priv->tx_triglevel_max)) { - ((sc->sc_ah->tx_trig_level) >= ath_rc_priv->tx_triglevel_max)) {
+ if ((tx_info->driver_flags & ATH_TX_INFO_UNDERRUN) && + if ((tx_info->pad[0] & ATH_TX_INFO_UNDERRUN) &&
+ (sc->sc_ah->tx_trig_level >= ath_rc_priv->tx_triglevel_max)) { + (sc->sc_ah->tx_trig_level >= ath_rc_priv->tx_triglevel_max)) {
tx_status = 1; tx_status = 1;
is_underrun = 1; is_underrun = 1;
@ -439,7 +439,7 @@
- if ((tx_info_priv->tx.ts_status & ATH9K_TXERR_XRETRY) || - if ((tx_info_priv->tx.ts_status & ATH9K_TXERR_XRETRY) ||
- (tx_info_priv->tx.ts_status & ATH9K_TXERR_FIFO)) - (tx_info_priv->tx.ts_status & ATH9K_TXERR_FIFO))
+ if (tx_info->driver_flags & ATH_TX_INFO_XRETRY) + if (tx_info->pad[0] & ATH_TX_INFO_XRETRY)
tx_status = 1; tx_status = 1;
ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status, ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status,