From: Johannes Berg <johannes@sipsolutions.net>
To: Ron Rindjunsky <ron.rindjunsky@intel.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
flamingice@sourmilk.net, tomas.winkler@intel.com,
yi.zhu@intel.com
Subject: Re: [PATCH 3/8] mac80211: A-MPDU Rx adding basic functionality
Date: Mon, 17 Dec 2007 19:06:41 +0100 [thread overview]
Message-ID: <1197914801.4885.74.camel@johannes.berg> (raw)
In-Reply-To: <11979070781347-git-send-email-ron.rindjunsky@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]
> +/* BACK parties */
Please write out "block-ack" or "BACK (block-ack)" :)
> +#define IEEE80211_MIN_AMPDU_BUF 0x8
> +#define IEEE80211_MAX_AMPDU_BUF 0x40
Any comments on what these represent? Should they be tunable?
> + if (tid_agg_rx->state != HT_AGG_STATE_IDLE) {
> +#ifdef CONFIG_MAC80211_HT_DEBUG
> + if (net_ratelimit())
> + printk(KERN_DEBUG "unexpected Block Ack Req from "
> + "%s on tid %u\n",
> + print_mac(mac, mgmt->sa), tid);
> +#endif /* CONFIG_MAC80211_HT_DEBUG */
> + goto end;
> + }
> +
> + /* prepare reordering buffer */
> + tid_agg_rx->reorder_buf =
> + kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);
> + if (!tid_agg_rx->reorder_buf) {
> + printk(KERN_ERR "can not allocate reordering buffer "
> + "to tid %d\n", tid);
> + tid_agg_rx->state = HT_AGG_STATE_IDLE;
That's unnecessary, you can't get here w/ state != IDLE afaict.
> + goto end;
> + }
> + memset(tid_agg_rx->reorder_buf, 0,
> + buf_size * sizeof(struct sk_buf *));
> +
> + if (local->ops->ampdu_action)
> + ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START,
> + sta->addr, tid, start_seq_num);
> + if (ret) {
> +#ifdef CONFIG_MAC80211_HT_DEBUG
> + if (net_ratelimit())
> + printk(KERN_DEBUG "A-MPDU on tid %d result: %s", tid,
> + (ret == -EOPNOTSUPP)? "Not Supported": "Driver Error");
I'm not sure we need to ratelimit debug messages, and I think we should
print out the error code. People who are writing a driver will need to
decipher the number but it's an error they return so I think we should
give them a chance to see which error path was hit.
> +void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
> + u16 initiator, u16 reason_code)
> +{
> + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> + struct ieee80211_if_sta *ifsta = &sdata->u.sta;
> + struct sk_buff *skb;
> + struct ieee80211_mgmt *mgmt;
> + u16 params;
> +
> + skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom + 1 +
> + sizeof(mgmt->u.action.u.delba));
> +
> + if (!skb) {
> + printk(KERN_ERR "%s: failed to allocate buffer "
> + "for delba frame\n", dev->name);
Do we send this as a reply to anything, ie. should it be rate-limited
too?
> +void ieee80211_sta_stop_rx_BA_session(struct net_device *dev, u8 *ra, u16 tid,
> + u16 initiator, u16 reason)
> +{
> + /* check if the TID is in opertional state */
small typo
> + /* stop HW Rx aggregation */
> + if (local->ops->ampdu_action) {
Can we get into that path with ops->ampdu_action == NULL? I'd think not
because state is required to be active... I'd rather stick in a
BUG_ON(!local->ops->ampdu_action)
because it seems to me that'd be a mac80211 bug.
> + * After receiving Block Ack Request (BAR) we activated a
> + * timer after each frame arrives from the originator.
> + * if this timer expires ieee80211_sta_stop_rx_BA_session will be executed.
> + */
> +void sta_rx_agg_session_timer_expired(unsigned long data)
> +{
> + /* not an elegant detour, but there is no choice as the timer passes
> + * only one argument, and ieee80211_local is needed here */
> + int *ptid = (int *)data;
> + int *timer_to_id = ptid - *ptid;
> + struct sta_info *temp_sta = container_of(timer_to_id, struct sta_info,
> + timer_to_tid[0]);
I think this needs more comments. I can, after a while, see what it
does, but I'm not even sure it's correct. The whole timer_to_id thing is
only for this code?
> + struct ieee80211_local *local = temp_sta->local;
> + struct sta_info *sta;
> + u16 tid = (u16)*ptid;
> + sta = sta_info_get(local, temp_sta->addr);
Missing newline.
> + if (!sta)
> + return;
Why do you even do a sta_info_get() on the temp_sta's addr? Either you
already have a good pointer or the whole thing will access invalid
memory.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2007-12-17 18:06 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-17 15:57 [PATCH 0/8] mac80211/iwlwifi: integrate IEEE802.11n A-MPDU Rx MLME Ron Rindjunsky
2007-12-17 15:57 ` [PATCH 1/8] mac80211: A-MPDU Rx add low level driver API Ron Rindjunsky
2007-12-17 17:54 ` Johannes Berg
2007-12-17 22:38 ` Johannes Berg
2007-12-18 13:41 ` Ron Rindjunsky
2007-12-18 14:01 ` Johannes Berg
2007-12-17 15:57 ` [PATCH 2/8] mac80211: A-MPDU Rx add MLME structures Ron Rindjunsky
2007-12-17 18:08 ` Johannes Berg
2007-12-18 13:41 ` Ron Rindjunsky
2007-12-18 13:59 ` Johannes Berg
2007-12-18 21:18 ` Johannes Berg
2007-12-19 18:59 ` Rindjunsky, Ron
2007-12-17 15:57 ` [PATCH 3/8] mac80211: A-MPDU Rx adding basic functionality Ron Rindjunsky
2007-12-17 18:06 ` Johannes Berg [this message]
2007-12-18 13:42 ` Ron Rindjunsky
2007-12-17 15:57 ` [PATCH 4/8] mac80211: A-MPDU Rx MLME data initialization Ron Rindjunsky
2007-12-17 18:09 ` Johannes Berg
2007-12-18 13:43 ` Ron Rindjunsky
2007-12-17 15:57 ` [PATCH 5/8] mac80211: A-MPDU Rx handling aggregation reordering Ron Rindjunsky
2007-12-17 18:18 ` Johannes Berg
2007-12-18 13:44 ` Ron Rindjunsky
2007-12-18 13:57 ` Johannes Berg
2007-12-19 10:57 ` Rindjunsky, Ron
2007-12-19 15:47 ` Johannes Berg
2007-12-19 16:29 ` Winkler, Tomas
2007-12-19 16:36 ` Johannes Berg
2007-12-20 10:14 ` Johannes Berg
2007-12-20 12:32 ` Ron Rindjunsky
2007-12-20 12:41 ` Johannes Berg
2007-12-20 14:15 ` Ron Rindjunsky
2007-12-23 16:15 ` Ron Rindjunsky
2007-12-23 17:28 ` Johannes Berg
2007-12-23 17:38 ` Ron Rindjunsky
2007-12-23 18:15 ` Johannes Berg
2007-12-17 15:57 ` [PATCH 6/8] mac80211: A-MPDU Rx adding BAR handling capability Ron Rindjunsky
2007-12-17 18:24 ` Johannes Berg
2007-12-18 13:45 ` Ron Rindjunsky
2007-12-18 13:53 ` Johannes Berg
2007-12-19 13:25 ` Rindjunsky, Ron
2007-12-19 15:45 ` Johannes Berg
2007-12-19 18:59 ` Rindjunsky, Ron
2007-12-17 15:57 ` [PATCH 7/8] mac80211: A-MPDU Rx handling DELBA requests Ron Rindjunsky
2007-12-17 18:26 ` Johannes Berg
2007-12-18 13:46 ` Ron Rindjunsky
2007-12-18 13:51 ` Johannes Berg
2007-12-19 13:22 ` Rindjunsky, Ron
2007-12-17 15:57 ` [PATCH 8/8] iwlwifi: A-MPDU Rx flow enabled Ron Rindjunsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1197914801.4885.74.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=flamingice@sourmilk.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=ron.rindjunsky@intel.com \
--cc=tomas.winkler@intel.com \
--cc=yi.zhu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox