[patch] d80211: Remove unused ENABLE_COMPRESSION, DISABLE_COMPRESSION cmds to hw->set_key
These two commands are currently unused. They were previously used to enable hardware compression on Atheros hardware. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -410,7 +410,6 @@ struct ieee80211_scan_conf { typedef enum { SET_KEY, DISABLE_KEY, REMOVE_ALL_KEYS, - ENABLE_COMPRESSION, DISABLE_COMPRESSION } set_key_cmd; /* Configuration block used by the low-level driver to tell the 802.11 code Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3721,10 +3721,6 @@ static int bcm43xx_net_set_key(struct ne bcm43xx_clear_keys(bcm); err = 0; break; - case ENABLE_COMPRESSION: - case DISABLE_COMPRESSION: - err = 0; - break; default: assert(0); } -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Madwifi-devel] ANNOUNCE: SFLC helps developers assessar5k (enabling free Atheros HAL)
On Wed, Nov 15, 2006 at 02:39:01PM -0500, Pavel Roskin wrote: > On Wed, 2006-11-15 at 14:21 -0500, John W. Linville wrote: > > On Wed, Nov 15, 2006 at 07:42:14PM +0100, Michael Buesch wrote: > > I said it before, and it's worth repeating. Dissolving HAL in the > sources is easy. It's just a matter of moving functions around without > serious chances of breaking anything as long as the source compiles. > The whole "HAL-based architecture" can be reshuffled and eliminated by > one person in a few days. > > Making things work properly takes years. That's what MadWifi has been > working on for a long time, using contributions and bug reports from > scores of users and developers. > > Rejecting MadWifi because it's HAL based is like throwing away a diamond > ring because it's too narrow. I completely agree. The approach we are taking with dadwifi[1] is to use much of the existing code from madwifi and port it to the d80211 stack. Today dadwifi works in monitor, sta and ap mode. -David [1] http://madwifi.org/wiki/DadWifi > > -- > Regards, > Pavel Roskin > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Madwifi-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/madwifi-devel - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
d80211: RFC: divide by zero when hw->maxssi not set
Hi, commit 448bf25bc9e3d70a211fdf235426472089371c43 added ieee80211_get_wireless_stats in net/d80211/ieee80211_ioctl.c. At present we get a divide by zero (oops) if the low level driver does not set the new hw->maxssi field. Perhaps: - reject registration of devices which do not set maxssi - do not attempt to report link quality for drivers which do not set maxssi - other ideas? -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: fix scan issues with new ops
On Sun, Nov 19, 2006 at 01:21:13AM +0100, Johannes Berg wrote: > If hardware shall do scanning, the hw_scan operation must be set. However, > if the driver is for multiple cards that may or may not do hardware > scanning, it'll need a flag. What is wrong with the driver setting the function pointer to NULL for the cards that do not support scanning? Where does this requirment come from that the function pointers in struct ieee80211_wiphy be identical for all cards? -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/10] d80211: reduce mdev usage, fix ieee80211_rx_mgmt
Reply-To: In-Reply-To: <[EMAIL PROTECTED]> > > --- wireless-dev.orig/net/d80211/ieee80211.c 2006-11-17 20:01:54.999703408 > +0100 > +++ wireless-dev/net/d80211/ieee80211.c 2006-11-17 20:01:55.659703408 > +0100 > @@ -210,9 +210,16 @@ static void ieee80211_key_threshold_noti > struct ieee80211_key *key, > struct sta_info *sta) > { > + struct ieee80211_local *local = dev->ieee80211_ptr; > struct sk_buff *skb; > struct ieee80211_msg_key_notification *msg; > > + /* if no one will get it anyway, don't even allocate it. > + * unlikely because this is only relevant for APs > + * where the device must be open... */ > + if (unlikely(!local->apdev)) > + return; Why not just let it Oops and show the bug? In what cases is it ok for apdev to not be set? > skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) + > sizeof(struct ieee80211_msg_key_notification)); > if (!skb) Can we get whitespace changes like this in a separate patch? > > -jiffies_to_timespec(status->hosttime, &ts); > + jiffies_to_timespec(status->hosttime, &ts); > fi->hosttime = cpu_to_be64((u64) ts.tv_sec * 100 + > ts.tv_nsec / 1000); > fi->mactime = cpu_to_be64(status->mactime); > switch (status->phymode) { > -case MODE_IEEE80211A: > -fi->phytype = htonl(ieee80211_phytype_ofdm_dot11_a); > -break; > -case MODE_IEEE80211B: > -fi->phytype = htonl(ieee80211_phytype_dsss_dot11_b); > -break; > -case MODE_IEEE80211G: > -fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g); > -break; > -case MODE_ATHEROS_TURBO: > + case MODE_IEEE80211A: > + fi->phytype = htonl(ieee80211_phytype_ofdm_dot11_a); > + break; > + case MODE_IEEE80211B: > + fi->phytype = htonl(ieee80211_phytype_dsss_dot11_b); > + break; > + case MODE_IEEE80211G: > + fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g); > + break; > + case MODE_ATHEROS_TURBO: > fi->phytype = > htonl(ieee80211_phytype_dsss_dot11_turbo); > break; > default: > -fi->phytype = 0x; > + fi->phytype = 0x; > break; > -} > -fi->channel = htonl(status->channel); > + } > + fi->channel = htonl(status->channel); . . . > int ieee80211_set_aid_for_sta(struct net_device *dev, u8 *peer_address, > u16 aid) > { > + struct ieee80211_local *local = dev->ieee80211_ptr; > struct sk_buff *skb; > struct ieee80211_msg_set_aid_for_sta *msg; > > + /* unlikely because if this event only happens for APs, > + * which require an open ap device. */ > + if (unlikely(!local->apdev)) > + return 0; again, so should we just let the Oops happen? -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: fix scan issues with new ops
On Sun, Nov 19, 2006 at 05:34:49PM +0100, Johannes Berg wrote: > On Sun, 2006-11-19 at 07:56 -0800, David Kimdon wrote: > > > What is wrong with the driver setting the function pointer to NULL for > > the cards that do not support scanning? Where does this requirment > > come from that the function pointers in struct ieee80211_wiphy be > > identical for all cards? > > Well I want to allow drivers to make assign the 33 function pointers in > a static structure, and differences between cards must then be handled > in the non-static part. ok. I am concerned that making this split between per driver and per card is difficult to get right. Setting or not setting a function pointer for an operation is fairly standard practice and I don't see the value in introducing yet another way to indicate support. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: fix scan issues with new ops
On Sun, Nov 19, 2006 at 05:57:39PM +0100, Johannes Berg wrote: > On Sun, 2006-11-19 at 08:55 -0800, David Kimdon wrote: > > > ok. I am concerned that making this split between per driver and per > > card is difficult to get right. Setting or not setting a function > > pointer for an operation is fairly standard practice and I don't see > > the value in introducing yet another way to indicate support. > > I guess we can punt this patch until some driver shows up that actually > has some cards that need the function and some that don't. I'm actually > guessing such a driver won't exist but wanted this for completeness in > the split between _wiphy and _ops. Perhaps that is a split that we do not need? I don't see the problem that 'd80211: split ieee80211_hw' is solving. I do see what it is doing, but maybe I am missing something . . . > > johannes - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Madwifi-devel] ar5k and Atheros AR5005G
On Wed, Nov 29, 2006 at 04:12:33PM +0100, Michael Buesch wrote: > On Wednesday 29 November 2006 15:34, Nick Kossifidis wrote: > > Good luck then ;-) > > > > If anyone wants to help on making ar5k work with newer madwifi > > versions and fix bugs etc (that 'll also help bsd ppl) plzz mail me. > > We can make it better. > > > > Nick > > P.S. Why not work on dawifi ? > > Because it won't be merged mainline either. Why do you say that? There is absolutely no reason why dadwifi can't be merged into the mainline once the hal issue is resolved. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Madwifi-devel] ar5k and Atheros AR5005G
On Wed, Nov 29, 2006 at 10:21:09AM -0500, Dan Williams wrote: > On Wed, 2006-11-29 at 16:12 +0100, Michael Buesch wrote: > > On Wednesday 29 November 2006 15:34, Nick Kossifidis wrote: > > > Good luck then ;-) > > > > > > If anyone wants to help on making ar5k work with newer madwifi > > > versions and fix bugs etc (that 'll also help bsd ppl) plzz mail me. > > > We can make it better. > > > > > > Nick > > > P.S. Why not work on dawifi ? > > > > Because it won't be merged mainline either. > > I thought dadwifi was supposed to replace net80211 with d80211 (but not > replace the binary HAL). yes > Aren't the two things complementary, yes > or did > you just decide that starting from scratch would produce a less crufty, > better understood, better-d80211 integrated driver? well, dadwifi will be (is) well integrated with d80211. As far as cruft goes, I'd rather call it historical artifacts :-) We are doing our best to minimize cruft while standing on the shoulders of madwifi. -David > > - > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Madwifi-devel] ar5k and Atheros AR5005G
On Wed, Nov 29, 2006 at 04:38:56PM +0100, Michael Buesch wrote: > On Wednesday 29 November 2006 16:24, David Kimdon wrote: > > On Wed, Nov 29, 2006 at 04:12:33PM +0100, Michael Buesch wrote: > > > On Wednesday 29 November 2006 15:34, Nick Kossifidis wrote: > > Why do you say that? > > > > There is absolutely no reason why dadwifi can't be merged into the > > mainline once the hal issue is resolved. > > Last time we talked about that stuff, it was decided that > we don't want a HAL... See archives. To be clear, that is all part of the hal issue that needs to be resolved. Removing the hal abstraction is not difficult for an interested party once source for the hal is available. The next step in such an effort would be to add an open hal to dadwifi, IMO. -David P.S. Actually, it isn't clear to me that removing the hal entirely is a good idea. Abstractions exist for practical reasons. The hal allows dadwifi to support a variety of Atheros chips without needing to worry about the specific details of each chip. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/7] d80211: allow for hardware crypto of default keys
Remove incorrect prohibition of hardware crypto support. This was originally present to prevent hardware crypto when more than one station interface was created for a single hardware device, the code in question is no longer correct and should be removed. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -537,9 +537,7 @@ static int ieee80211_set_encryption(stru } key = sdata->keys[idx]; - /* Disable hwaccel for default keys when the interface is not -* the default one. -* TODO: consider adding hwaccel support for these; at least + /* TODO: consider adding hwaccel support for these; at least * Atheros key cache should be able to handle this since AP is * only transmitting frames with default keys. */ /* FIX: hw key cache can be used when only one virtual @@ -548,11 +546,6 @@ static int ieee80211_set_encryption(stru * must be used. This should be done automatically * based on configured station devices. For the time * being, this can be only set at compile time. */ - /* FIXME: There is no more anything like "default -* interface". We should try hwaccel if there is just one -* interface - for now, hwaccel is unconditionaly -* disabled. */ - try_hwaccel = 0; } else { set_tx_key = 0; if (idx != 0) { -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 5/7] d80211: remove unused references to sub interface data
In these three cases the pointer returned by IEEE80211_DEV_TO_SUB_IF() is never used. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -1362,11 +1362,9 @@ static int ieee80211_master_start_xmit(s struct ieee80211_tx_control control; struct ieee80211_tx_packet_data *pkt_data; struct net_device *odev = NULL; - struct ieee80211_sub_if_data *sdata, *osdata; + struct ieee80211_sub_if_data *osdata; int ret; - sdata = IEEE80211_DEV_TO_SUB_IF(dev); - /* * copy control out of the skb so other people can use skb->cb */ Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -407,10 +407,8 @@ static int ieee80211_ioctl_get_info_sta( if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff && param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { - struct ieee80211_sub_if_data *sdata; struct net_device_stats *stats; - sdata = IEEE80211_DEV_TO_SUB_IF(dev); stats = ieee80211_dev_stats(local->mdev); param->u.get_info_sta.rx_bytes = stats->rx_bytes; param->u.get_info_sta.tx_bytes = stats->tx_bytes; Index: wireless-dev/net/d80211/ieee80211_iface.c === --- wireless-dev.orig/net/d80211/ieee80211_iface.c +++ wireless-dev/net/d80211/ieee80211_iface.c @@ -42,7 +42,7 @@ int ieee80211_if_add(struct net_device * { struct net_device *ndev, *tmp_dev; struct ieee80211_local *local = dev->ieee80211_ptr; - struct ieee80211_sub_if_data *sdata = NULL, *sdata_parent; + struct ieee80211_sub_if_data *sdata = NULL; int ret; int i; @@ -83,7 +83,6 @@ int ieee80211_if_add(struct net_device * sdata->type = IEEE80211_IF_TYPE_AP; sdata->dev = ndev; sdata->local = local; - sdata_parent = IEEE80211_DEV_TO_SUB_IF(dev); ieee80211_if_sdata_init(sdata); ret = register_netdevice(ndev); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 7/7] d80211: do not pass an invalid key index to set_key()
If a hardware key has not been configured then there is no point to calling DISABLE_KEY. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -612,7 +612,7 @@ static int ieee80211_set_encryption(stru if (alg == ALG_NONE) { keyconf = NULL; - if (try_hwaccel && key && local->ops->set_key && + if (try_hwaccel && key && key->hw_key_idx != -1 && local->ops->set_key && (keyconf = ieee80211_key_data2conf(local, key)) != NULL && local->ops->set_key(local_to_hw(local), DISABLE_KEY, sta_addr, keyconf, sta ? sta->aid : 0)) { -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/7] d80211: fix potential invalid array index returning key information
sdata->keys[] has NUM_DEFAULT_KEYS elements, don't access past that. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -803,7 +803,7 @@ static int ieee80211_ioctl_get_encryptio param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff && param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { sta = NULL; - if (param->u.crypt.idx > NUM_DEFAULT_KEYS) { + if (param->u.crypt.idx >= NUM_DEFAULT_KEYS) { param->u.crypt.idx = sdata->default_key ? sdata->default_key->keyidx : 0; return 0; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/7] d80211: fix potential interface name overflow
dev->name and ndev->name are both IFNAMSIZ in length, the ".%d" is not guarenteed to fit in ndev->name. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_iface.c === --- wireless-dev.orig/net/d80211/ieee80211_iface.c +++ wireless-dev/net/d80211/ieee80211_iface.c @@ -56,7 +56,8 @@ int ieee80211_if_add(struct net_device * if (strlen(name) == 0) { i = 0; do { - sprintf(ndev->name, "%s.%d", dev->name, i++); + snprintf(ndev->name, sizeof(ndev->name), "%s.%d", +dev->name, i++); tmp_dev = dev_get_by_name(ndev->name); if (!tmp_dev) break; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/7] d80211: set default_wep_only dynamically
Without this change d80211 relies on userspace to let it know when it can configure default wep keys. It is always safe to set default_wep_only if there is a single station interface. This allows for hardware accelleration for the case of a single station interface. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_i.h === --- wireless-dev.orig/net/d80211/ieee80211_i.h +++ wireless-dev/net/d80211/ieee80211_i.h @@ -607,6 +607,7 @@ extern const struct iw_handler_def ieee8 int ieee80211_set_hw_encryption(struct net_device *dev, struct sta_info *sta, u8 addr[ETH_ALEN], struct ieee80211_key *key); +void ieee80211_update_default_wep_only(struct ieee80211_local *local); /* ieee80211_scan.c */ void ieee80211_init_scan(struct ieee80211_local *local); Index: wireless-dev/net/d80211/ieee80211_iface.c === --- wireless-dev.orig/net/d80211/ieee80211_iface.c +++ wireless-dev/net/d80211/ieee80211_iface.c @@ -97,6 +97,7 @@ int ieee80211_if_add(struct net_device * } list_add(&sdata->list, &local->sub_if_list); + ieee80211_update_default_wep_only(local); return 0; @@ -164,6 +165,7 @@ void ieee80211_if_del_mgmt(struct ieee80 void ieee80211_if_set_type(struct net_device *dev, int type) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = dev->ieee80211_ptr; sdata->type = type; switch (type) { @@ -205,6 +207,7 @@ void ieee80211_if_set_type(struct net_de dev->name, __FUNCTION__, type); } ieee80211_sysfs_change_if_type(dev); + ieee80211_update_default_wep_only(local); } /* Must be called with rtnl lock held. */ @@ -329,6 +332,7 @@ int ieee80211_if_remove(struct net_devic strcmp(name, sdata->dev->name) == 0 && sdata->dev != local->mdev) { __ieee80211_if_del(local, sdata); + ieee80211_update_default_wep_only(local); return 0; } } Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -2357,6 +2357,36 @@ static int ieee80211_ioctl_default_wep_o } +void ieee80211_update_default_wep_only(struct ieee80211_local *local) +{ + int i = 0; + struct ieee80211_sub_if_data *sdata; + + spin_lock_bh(&local->sub_if_lock); + list_for_each_entry(sdata, &local->sub_if_list, list) { + + if (sdata->dev == local->mdev) + continue; + + /* If there is an AP interface then depend on userspace to + set default_wep_only correctly. */ + if (sdata->type == IEEE80211_IF_TYPE_AP) { + spin_unlock_bh(&local->sub_if_lock); + return; + } + + i++; + } + + if (i <= 1) + ieee80211_ioctl_default_wep_only(local, 1); + else + ieee80211_ioctl_default_wep_only(local, 0); + + spin_unlock_bh(&local->sub_if_lock); +} + + static int ieee80211_ioctl_prism2_param(struct net_device *dev, struct iw_request_info *info, void *wrqu, char *extra) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 6/7] d80211: fix invalid check for sub interface type AP
We should be checking the type member, not the raw pointer. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -1996,7 +1996,7 @@ static int ieee80211_ioctl_siwscan(struc sdata->type == IEEE80211_IF_TYPE_IBSS) { ssid = sdata->u.sta.ssid; ssid_len = sdata->u.sta.ssid_len; - } else if (sdata == IEEE80211_IF_TYPE_AP) { + } else if (sdata->type == IEEE80211_IF_TYPE_AP) { ssid = sdata->u.ap.ssid; ssid_len = sdata->u.ap.ssid_len; } else -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 7/7] d80211: do not pass an invalid key index to set_key()
> Use HW_KEY_IDX_INVALID, please. oops, here you go (also fixed bad indentation): -- d80211: do not pass an invalid key index to set_key() If a hardware key has not been configured then there is no point to calling DISABLE_KEY. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -612,7 +612,9 @@ static int ieee80211_set_encryption(stru if (alg == ALG_NONE) { keyconf = NULL; - if (try_hwaccel && key && local->ops->set_key && + if (try_hwaccel && key && + key->hw_key_idx != HW_KEY_IDX_INVALID && + local->ops->set_key && (keyconf = ieee80211_key_data2conf(local, key)) != NULL && local->ops->set_key(local_to_hw(local), DISABLE_KEY, sta_addr, keyconf, sta ? sta->aid : 0)) { - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: add radiotap support
On Sat, Dec 16, 2006 at 06:01:03PM -0500, Michael Wu wrote: > skb->mac.raw = skb->data; > skb->ip_summed = CHECKSUM_UNNECESSARY; > skb->pkt_type = PACKET_OTHERHOST; > - skb->protocol = htons(ETH_P_802_2); > + skb->protocol = __constant_htons(ETH_P_802_2); > memset(skb->cb, 0, sizeof(skb->cb)); > netif_rx(skb); htons and friends can handle determining the argument is a constant on their own, so this change should be dropped. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
d80211: clear ifsta->associated flag when authentication starts
The 'associated' flag might be set if a previous association did not end cleanly. If the 'associated' flag is left set here then when association succeeds ieee80211_set_associated() will think there is nothing to report and will not inform userspace of the event. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -1960,7 +1960,7 @@ static void ieee80211_sta_new_auth(struc printk(KERN_DEBUG "%s: Initial auth_alg=%d\n", dev->name, ifsta->auth_alg); ifsta->auth_transaction = -1; - ifsta->auth_tries = ifsta->assoc_tries = 0; + ifsta->associated = ifsta->auth_tries = ifsta->assoc_tries = 0; ieee80211_authenticate(dev, ifsta); } -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
d80211: inhibit duplicate authentication requests when setting bssid
If we are already authenticating don't send another authentication request. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -2392,7 +2392,7 @@ int ieee80211_sta_set_bssid(struct net_d ifsta->bssid_set = 0; else ifsta->bssid_set = 1; - if (ifsta->ssid_set) + if (ifsta->ssid_set && ifsta->state != IEEE80211_AUTHENTICATE) ieee80211_sta_new_auth(dev, ifsta); return 0; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 0/5] d80211 patches
Hi, Here are some patches for d80211. Thanks, David -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/5] d80211: fix interface removal
Calls to ieee80211_if_remove() should use the ieee80211 interface types. Convert interface type from hostapd to ieee80211 format. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -1076,14 +1076,21 @@ static int ieee80211_ioctl_add_if(struct static int ieee80211_ioctl_remove_if(struct net_device *dev, struct prism2_hostapd_param *param) { - if (param->u.if_info.type != HOSTAP_IF_WDS && - param->u.if_info.type != HOSTAP_IF_VLAN && - param->u.if_info.type != HOSTAP_IF_BSS && - param->u.if_info.type != HOSTAP_IF_STA) { -return -EINVAL; + unsigned int type; + + if (param->u.if_info.type == HOSTAP_IF_WDS) { + type = IEEE80211_IF_TYPE_WDS; + } else if (param->u.if_info.type == HOSTAP_IF_VLAN) { + type = IEEE80211_IF_TYPE_VLAN; + } else if (param->u.if_info.type == HOSTAP_IF_BSS) { + type = IEEE80211_IF_TYPE_AP; + } else if (param->u.if_info.type == HOSTAP_IF_STA) { + type = IEEE80211_IF_TYPE_STA; + } else { +return -EINVAL; } - return ieee80211_if_remove(dev, param->u.if_info.name, - param->u.if_info.type); + + return ieee80211_if_remove(dev, param->u.if_info.name, type); } -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/5] d80211: fix multiple device support
Fix interpretation of dev_alloc_name() return value. dev_alloc_name() returns the number of the unit assigned or a negative errno code. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_iface.c === --- wireless-dev.orig/net/d80211/ieee80211_iface.c +++ wireless-dev/net/d80211/ieee80211_iface.c @@ -64,7 +64,7 @@ int ieee80211_if_add(struct net_device * } while (i < 1); } else if (format) { ret = dev_alloc_name(ndev, name); - if (ret) + if (ret < 0) goto fail; } else { snprintf(ndev->name, IFNAMSIZ, "%s", name); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/5] d80211: allow for large scan results
Fix a problem where incomplete scan results could be returned if the environment includes a large number of devices. Do not truncate the scan results and allow a result to contain more than IW_SCAN_MAX_DATA bytes. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -2753,6 +2753,10 @@ int ieee80211_sta_scan_results(struct ne spin_lock_bh(&local->sta_bss_lock); list_for_each(ptr, &local->sta_bss_list) { bss = list_entry(ptr, struct ieee80211_sta_bss, list); + if (buf + len - current_ev <= IW_EV_ADDR_LEN) { + spin_unlock_bh(&local->sta_bss_lock); + return -E2BIG; + } current_ev = ieee80211_sta_scan_result(dev, bss, current_ev, end_buf); } Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -1998,7 +1998,7 @@ static int ieee80211_ioctl_giwscan(struc struct ieee80211_local *local = dev->ieee80211_ptr; if (local->sta_scanning) return -EAGAIN; - res = ieee80211_sta_scan_results(dev, extra, IW_SCAN_MAX_DATA); + res = ieee80211_sta_scan_results(dev, extra, data->length); if (res >= 0) { data->length = res; return 0; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 5/5] d80211: add ioctl to stop data frame tx
This ioctl is used when radar is delected on a channel. Data frames must stop but management frames must be allowed to continue for some time to communicate the channel switch to stations. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: linux-2.6.16/net/d80211/hostapd_ioctl.h === --- linux-2.6.16.orig/net/d80211/hostapd_ioctl.h +++ linux-2.6.16/net/d80211/hostapd_ioctl.h @@ -93,6 +93,7 @@ enum { PRISM2_PARAM_SPECTRUM_MGMT = 1044, PRISM2_PARAM_USER_SPACE_MLME = 1045, PRISM2_PARAM_MGMT_IF = 1046, + PRISM2_PARAM_STOP_DATA_FRAME_TX = 1047, /* NOTE: Please try to coordinate with other active development * branches before allocating new param numbers so that each new param * will be unique within all branches and the allocated number will not Index: linux-2.6.16/net/d80211/ieee80211.c === --- linux-2.6.16.orig/net/d80211/ieee80211.c +++ linux-2.6.16/net/d80211/ieee80211.c @@ -1240,6 +1240,15 @@ static int ieee80211_tx(struct net_devic return 0; } + if (unlikely(local->stop_data_frame_tx)) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + u16 fc = le16_to_cpu(hdr->frame_control); + if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) { + dev_kfree_skb(skb); + return 0; + } + } + __ieee80211_tx_prepare(&tx, skb, dev, control); sta = tx.sta; tx.u.tx.mgmt_interface = mgmt; Index: linux-2.6.16/net/d80211/ieee80211_i.h === --- linux-2.6.16.orig/net/d80211/ieee80211_i.h +++ linux-2.6.16/net/d80211/ieee80211_i.h @@ -532,6 +532,8 @@ struct ieee80211_local { * (1 << MODE_*) */ int user_space_mlme; + int stop_data_frame_tx; /* Set to 1 to stop transmission +* of data frames. */ }; enum ieee80211_link_state_t { Index: linux-2.6.16/net/d80211/ieee80211_ioctl.c === --- linux-2.6.16.orig/net/d80211/ieee80211_ioctl.c +++ linux-2.6.16/net/d80211/ieee80211_ioctl.c @@ -1300,6 +1300,14 @@ static int ieee80211_ioctl_set_radio_ena return ieee80211_hw_config(dev); } +static int ieee80211_ioctl_set_stop_data_frame_tx(struct net_device *dev, + int val) +{ + struct ieee80211_local *local = dev->ieee80211_ptr; +local->stop_data_frame_tx = val; +return 0; +} + static int ieee80211_ioctl_set_tx_queue_params(struct net_device *dev, struct prism2_hostapd_param *param) @@ -2612,6 +2620,9 @@ static int ieee80211_ioctl_prism2_param( case PRISM2_PARAM_USER_SPACE_MLME: local->user_space_mlme = value; break; + case PRISM2_PARAM_STOP_DATA_FRAME_TX: +ret = ieee80211_ioctl_set_stop_data_frame_tx(dev, value); + break; default: ret = -EOPNOTSUPP; break; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/5] d80211/bcm43xx: fix build for ARM
ARM targets support udelay(N) where N <= 2000. Use mdelay() when N >= 2000. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_power.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_power.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_power.c @@ -291,7 +291,7 @@ int bcm43xx_pctl_set_crystal(struct bcm4 err = bcm43xx_pci_write_config32(bcm, BCM43xx_PCTL_OUT, out); if (err) goto err_pci; - udelay(5000); + mdelay(5); } else { if (bcm->current_core->rev < 5) return 0; Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_radio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_radio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_radio.c @@ -1687,7 +1687,7 @@ int bcm43xx_radio_selectchannel(struct b radio->channel = channel; //XXX: Using the longer of 2 timeouts (8000 vs 2000 usecs). Specs states // that 2000 usecs might suffice. - udelay(8000); + mdelay(8); return 0; } -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: fix crash in ieee80211_rx_michael_mic_report()
This fixes a crash at ieee80211.c line 3461, ieee80211_rx_michael_mic_report() (rx->sdata->type == IEEE80211_IF_TYPE_AP). rx.sdata needs to be set before calling ieee80211_rx_michael_mic_report(). Signed-off-by: Elliot Schwartz <[EMAIL PROTECTED]> Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -3582,6 +3582,11 @@ void __ieee80211_rx(struct net_device *d else sta = rx.sta = NULL; + if (sta) { + rx.dev = sta->dev; + rx.sdata = IEEE80211_DEV_TO_SUB_IF(rx.dev); + } + if ((status->flag & RX_FLAG_MMIC_ERROR)) { ieee80211_rx_michael_mic_report(dev, hdr, sta, &rx); goto end; @@ -3597,8 +3602,6 @@ void __ieee80211_rx(struct net_device *d if (sta && !sta->assoc_ap && !(sta->flags & WLAN_STA_WDS) && !local->iff_promiscs && !multicast) { - rx.dev = sta->dev; - rx.sdata = IEEE80211_DEV_TO_SUB_IF(rx.dev); rx.u.rx.ra_match = 1; ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx, sta); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: fix multiple device ap support
Another fix to the interpretation of dev_alloc_name() return value. dev_alloc_name() returns the number of the unit assigned or a negative errno code. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: linux-2.6.16/net/d80211/ieee80211_iface.c === --- linux-2.6.16.orig/net/d80211/ieee80211_iface.c +++ linux-2.6.16/net/d80211/ieee80211_iface.c @@ -122,7 +122,7 @@ int ieee80211_if_add_mgmt(struct net_dev if (!ndev) return -ENOMEM; ret = dev_alloc_name(ndev, "wmgmt%d"); - if (ret) + if (ret < 0) goto fail; ndev->ieee80211_ptr = local; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] Fix type of prism2_hostapd_param crypt.alg
crypt.alg is a string, use the correct type. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -207,7 +207,7 @@ struct prism2_hostapd_param { u32 last_ack_rssi; } get_info_sta; struct { - u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN]; + char alg[HOSTAP_CRYPT_ALG_NAME_LEN]; u32 flags; u32 err; u8 idx; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: fix WEP on big endian cpus
The ICV is transmitted on the network as a 4 byte little endian quantity. WEP encryption needs to swap the bytes before transmission and decryption needs to swap bytes before ICV verification. Index: wireless-dev/net/d80211/wep.c === --- wireless-dev.orig/net/d80211/wep.c 2006-09-10 14:50:52.073583400 + +++ wireless-dev/net/d80211/wep.c 2006-09-10 14:51:10.146835848 + @@ -121,9 +121,11 @@ { struct scatterlist sg; u32 *icv; + u32 crc; icv = (u32 *)(data + data_len); - *icv = ~crc32_le(~0, data, data_len); + crc = ~crc32_le(~0, data, data_len); + *icv = cpu_to_le32(crc); crypto_cipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); @@ -196,6 +198,7 @@ crypto_cipher_decrypt(tfm, &sg, &sg, sg.length); crc = ~crc32_le(~0, data, data_len); + crc = cpu_to_le32(crc); if (memcmp(&crc, data + data_len, WEP_ICV_LEN) != 0) /* ICV mismatch */ return -1; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: remove sub-interface mac address policy
Wireless vlan interfaces need to have the same mac address as other sub interfaces. Rather than complicate the kernel here by adding yet another case where uniqueness is not required, remove the check on mac address uniqueness altogether. We should not implement a mac address allocation policy here. It is difficult to get it right in all cases and does not belong in the kernel. It is better to leave this to be implemented as a userspace policy. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: linux-2.6.16/net/d80211/ieee80211.c === --- linux-2.6.16.orig/net/d80211/ieee80211.c +++ linux-2.6.16/net/d80211/ieee80211.c @@ -2116,17 +2116,6 @@ static struct net_device_stats *ieee8021 return &(sdata->stats); } -static inline int identical_mac_addr_allowed(int type1, int type2) -{ - return (type1 == IEEE80211_IF_TYPE_MNTR || - type2 == IEEE80211_IF_TYPE_MNTR || - (type1 == IEEE80211_IF_TYPE_AP && -type2 == IEEE80211_IF_TYPE_WDS) || - (type1 == IEEE80211_IF_TYPE_WDS && -(type2 == IEEE80211_IF_TYPE_WDS || - type2 == IEEE80211_IF_TYPE_AP))); -} - static int ieee80211_master_open(struct net_device *dev) { struct ieee80211_local *local = dev->ieee80211_ptr; @@ -2202,22 +2191,12 @@ static void ieee80211_start_hard_monitor static int ieee80211_open(struct net_device *dev) { - struct ieee80211_sub_if_data *sdata, *nsdata; + struct ieee80211_sub_if_data *sdata; struct ieee80211_local *local = dev->ieee80211_ptr; struct ieee80211_if_init_conf conf; int res; sdata = IEEE80211_DEV_TO_SUB_IF(dev); - list_for_each_entry(nsdata, &local->sub_if_list, list) { - struct net_device *ndev = nsdata->dev; - - if (ndev != dev && ndev != local->mdev && - netif_running(ndev) && - memcmp(dev->dev_addr, ndev->dev_addr, ETH_ALEN) == 0 && - !identical_mac_addr_allowed(sdata->type, nsdata->type)) { - return -ENOTUNIQ; - } - } if (sdata->type == IEEE80211_IF_TYPE_WDS && memcmp(sdata->u.wds.remote_addr, "\0\0\0\0\0\0", ETH_ALEN) == 0) return -ENOLINK; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: allow vlan interfaces to receive ToDS frames
Interfaces of type IEEE80211_IF_TYPE_VLAN are similar to AP interfaces. One difference is stations are bound to a particular vlan interface after authentication/association based on management policy (for example a radius server). Interfaces of type IEEE80211_IF_TYPE_VLAN need to be able to receive ToDS frames. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -2353,7 +2353,8 @@ ieee80211_rx_h_data(struct ieee80211_txr memcpy(dst, hdr->addr3, ETH_ALEN); memcpy(src, hdr->addr2, ETH_ALEN); - if (unlikely(sdata->type != IEEE80211_IF_TYPE_AP)) { + if (unlikely(sdata->type != IEEE80211_IF_TYPE_AP && +sdata->type != IEEE80211_IF_TYPE_VLAN)) { printk(KERN_DEBUG "%s: dropped ToDS frame (BSSID=" MAC_FMT " SA=" MAC_FMT " DA=" MAC_FMT ")\n", dev->name, MAC_ARG(hdr->addr1), -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
leak in bridge netfilter if skb traverses > 1 bridge
When the bridge topology allows a single skb to traverse more than one bridge we end up leaking skb->nf_bridge each time the skb enters the second or higher bridge. The leak occurs when bridge netfilter is enabled on 2.4 (with bridge netfilter patch) and 2.6 git head, proposed 2.4 fix below. Leaky topology: brvlan1 -> vlan1 __ \-> brtrunk -> eth0 To configure the above toploogy, something like: brctl addbr brtrunk brctl addif brtrunk eth0 ifconfig eth0 0.0.0.0 ifconfig brtrunk 0.0.0.0 vconfig set_name_type VLAN_PLUS_VID_NO_PAD vconfig add brtrunk 1 ifconfig vlan1 up brctl addbr brvlan1 brctl addif brvlan1 vlan1 ifconfig brvlan1 10.10.0.1 To see the leak send a packet between 10.10.0.1 and anywhere that causes the packet to pass through brvlan1 and brtrunk. For example, a host 10.10.0.2 on the same physical network as eth0 configured: vconfig set_name_type VLAN_PLUS_VID_NO_PAD vconfig add eth0 1 ifconfig vlan1 10.10.0.2 A proposed fix for 2.4 follows. I don't understand completely the way packets traverse bridge netfilter so I have only called nf_bridge_put() where I see the leak. Perhaps nf_bridge_put() should be called before other calls to nf_bridge_alloc(). * net/bridge/br_netfilter.c (br_nf_pre_routing) : Call nf_bridge_put() before potentially allocating a new nf_bridge structure and overwriting the pointer to it. * net/core/skbuff.c (alloc_skb) : Initialize nf_bridge to NULL so we can safely call nf_bridge_put() on newly allocated skb's. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> --- linux-2.4.x/net/bridge/br_netfilter.c +++ linux-2.4.x/net/bridge/br_netfilter.c @@ -284,6 +284,7 @@ #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_IP_PRE_ROUTING); #endif + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; --- linux-2.4.x/net/core/skbuff.c +++ linux-2.4.x/net/core/skbuff.c @@ -216,6 +216,9 @@ atomic_set(&(skb_shinfo(skb)->dataref), 1); skb_shinfo(skb)->nr_frags = 0; skb_shinfo(skb)->frag_list = NULL; +#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) + skb->nf_bridge = NULL; +#endif return skb; nodata: -- David Kimdon(650) 829 2621 Devicescape Software - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Re: leak in bridge netfilter if skb traverses > 1 bridge
Indeed, as Herbert pointed out, no need to NULL the pointer, updated patch follows. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> * net/bridge/br_netfilter.c (br_nf_pre_routing) : Call nf_bridge_put() before potentially allocating a new nf_bridge structure and overwriting the pointer to it. This fixes a memory leak when the bridge topology allows for an skb to traverse more than one bridge. --- linux-2.4.x/net/bridge/br_netfilter.c +++ linux-2.4.x/net/bridge/br_netfilter.c @@ -284,6 +284,7 @@ #ifdef CONFIG_NETFILTER_DEBUG skb->nf_debug ^= (1 << NF_IP_PRE_ROUTING); #endif + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; -- David Kimdon(650) 829 2621 Devicescape Software - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[2.6 PATCH] Re: leak in bridge netfilter if skb traverses > 1 bridge
The patch I posted previously applies to 2.4. The following patch applies to 2.6. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> * net/bridge/br_netfilter.c (br_nf_pre_routing, br_nf_pre_routing_ipv6) : Call nf_bridge_put() before allocating a new nf_bridge structure and potentially overwriting the pointer to a previously allocated one. This fixes a memory leak which can occur when the bridge topology allows for an skb to traverse more than one bridge. diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -372,6 +372,7 @@ static unsigned int br_nf_pre_routing_ip if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb)) goto inhdr_error; + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); @@ -455,6 +456,7 @@ static unsigned int br_nf_pre_routing(un skb->ip_summed = CHECKSUM_NONE; } + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); -- David Kimdon(650) 829 2621 Devicescape Software - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Resend: [2.6 PATCH] Re: leak in bridge netfilter if skb traverses > 1 bridge
Hi, Resending to make sure this doesn't fall through the cracks. The following patch applies to 2.6 and fixes a memory leak. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> * net/bridge/br_netfilter.c (br_nf_pre_routing, br_nf_pre_routing_ipv6) : Call nf_bridge_put() before allocating a new nf_bridge structure and potentially overwriting the pointer to a previously allocated one. This fixes a memory leak which can occur when the bridge topology allows for an skb to traverse more than one bridge. diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -372,6 +372,7 @@ static unsigned int br_nf_pre_routing_ip if (hdr->nexthdr == NEXTHDR_HOP && check_hbh_len(skb)) goto inhdr_error; + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); @@ -455,6 +456,7 @@ static unsigned int br_nf_pre_routing(un skb->ip_summed = CHECKSUM_NONE; } + nf_bridge_put(skb->nf_bridge); if ((nf_bridge = nf_bridge_alloc(skb)) == NULL) return NF_DROP; setup_pre_routing(skb); -- David Kimdon Devicescape Software - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch] d80211: remove sub-interface mac address policy
On Thu, Sep 21, 2006 at 08:09:39PM +0200, Jiri Benc wrote: > On Thu, 14 Sep 2006 07:33:21 -0700, David Kimdon wrote: > > Wireless vlan interfaces need to have the same mac address as > > other sub interfaces. Rather than complicate the kernel here by > > adding yet another case where uniqueness is not required, remove > > the check on mac address uniqueness altogether. > > > > We should not implement a mac address allocation policy here. It > > is difficult to get it right in all cases and does not belong in > > the kernel. It is better to leave this to be implemented as a > > userspace policy. > > I disagree. This is not about policy, this is about prevention of > accidental violation of IEEE 802.11. The only effect of this patch would > be forcing drivers to do that check themselves thus duplicating code. That is fine, I don't feel strongly, I will cook up a patch that fixes the check for vlan interfaces. > What is the purpose of "wireless vlans"? We use wireless vlans to isolate stations to separate multicast domains within the same bss based on the input of a radius server. A stations is bound to a particular wireless vlan interface, all stations on that wireless vlan share broadcast keys, and the wireless vlan interface can be bridged to a particular wired vlan. > Is it something Atheros-specific? no, it is chip driver agnostic. > Is it documented somewhere? Or is it in some of IEEE 802.11 > standards and I just overlooked it? (In that case I would be more > than happy to review the whole stack and fix it.) Could you send us > some pointers? Take a look at http://www.ietf.org/rfc/rfc3580.txt section 3.31. Tunnel Attributes. That is what we are processing at a high level to get vlan assignment. FWIW, we have code on its way to hostapd cvs that uses wireless vlans which will show more details of this particular implementation. David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/5] d80211: retain PS frames for at least STA listen interval
From: Jouni Malinen <[EMAIL PROTECTED]> Start using 2 * listen_int * beacon_int as a timeout for PS buffered unicast frames if that is longer than 10 seconds. Previously, we used fixed 10 second limit regardless of the listen interval. This fixes power saving for STAs that request very long listen interval (over 10 seconds). This was reported by UNH IOL 802.11 AP Base MAC Test Suite v2.4 Test #1.3.2 Part e. While we are at it, remove the station from the TIM when the PS buffer is empty. Signed-off-by: Jouni Malinen <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -189,6 +189,7 @@ struct prism2_hostapd_param { u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; + u16 listen_interval; } add_sta; struct { u32 inactive_msec; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -296,6 +296,7 @@ static int ieee80211_ioctl_add_sta(struc sta->aid = param->u.add_sta.aid; if (sta->aid > IEEE80211_MAX_AID) sta->aid = 0; + sta->listen_interval = param->u.add_sta.listen_interval; rates = 0; for (i = 0; i < sizeof(param->u.add_sta.supp_rates); i++) { Index: wireless-dev/net/d80211/sta_info.c === --- wireless-dev.orig/net/d80211/sta_info.c +++ wireless-dev/net/d80211/sta_info.c @@ -269,18 +269,24 @@ void sta_info_free(struct sta_info *sta, } -static inline int sta_info_buffer_expired(struct sk_buff *skb) +static inline int sta_info_buffer_expired(struct ieee80211_local *local, + struct sta_info *sta, + struct sk_buff *skb) { struct ieee80211_tx_packet_data *pkt_data; + int timeout; + if (!skb) return 0; - /* TODO: this could be improved by passing STA listen interval into -* the kernel driver and expiring frames after 2 x listen_interval x - * beacon interval */ - pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; - return time_after(jiffies, pkt_data->jiffies + STA_TX_BUFFER_EXPIRE); + + /* Timeout: (2 * listen_interval * beacon_int * 1024 / 100) sec */ + timeout = (sta->listen_interval * local->conf.beacon_int * 32 / + 15625) * HZ; + if (timeout < STA_TX_BUFFER_EXPIRE) + timeout = STA_TX_BUFFER_EXPIRE; + return time_after(jiffies, pkt_data->jiffies + timeout); } @@ -296,9 +302,11 @@ static void sta_info_cleanup_expire_buff for (;;) { spin_lock_irqsave(&sta->ps_tx_buf.lock, flags); skb = skb_peek(&sta->ps_tx_buf); - if (sta_info_buffer_expired(skb)) + if (sta_info_buffer_expired(local, sta, skb)) { skb = __skb_dequeue(&sta->ps_tx_buf); - else + if (skb_queue_empty(&sta->ps_tx_buf)) + sta->flags &= ~WLAN_STA_TIM; + } else skb = NULL; spin_unlock_irqrestore(&sta->ps_tx_buf.lock, flags); Index: wireless-dev/net/d80211/sta_info.h === --- wireless-dev.orig/net/d80211/sta_info.h +++ wireless-dev/net/d80211/sta_info.h @@ -107,6 +107,8 @@ struct sta_info { #endif /* CONFIG_D80211_DEBUG_COUNTERS */ int vlan_id; + + u16 listen_interval; }; @@ -120,7 +122,8 @@ struct sta_info { /* Maximum number of frames to buffer per power saving station */ #define STA_MAX_TX_BUFFER 128 -/* Buffered frame expiry time */ +/* Minimum buffered frame expiry time. If STA uses listen interval that is + * smaller than this value, the minimum value here is used instead. */ #define STA_TX_BUFFER_EXPIRE (10 * HZ) /* How often station data is cleaned up (e.g., expiration of buffered frames) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 5/5] d80211: allow wireless vlan interface to have same MAC an AP interface
Wireless vlan interfaces need to have the same mac address as AP interfaces. The STA must not see the change when it is bound to a specific vlan, so the address of the vlan interface must be the same as the address of the AP interface the station associated with. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -2092,7 +2092,12 @@ static inline int identical_mac_addr_all type2 == IEEE80211_IF_TYPE_WDS) || (type1 == IEEE80211_IF_TYPE_WDS && (type2 == IEEE80211_IF_TYPE_WDS || - type2 == IEEE80211_IF_TYPE_AP))); + type2 == IEEE80211_IF_TYPE_AP)) || + (type1 == IEEE80211_IF_TYPE_AP && +type2 == IEEE80211_IF_TYPE_VLAN) || + (type1 == IEEE80211_IF_TYPE_VLAN && +(type2 == IEEE80211_IF_TYPE_AP || + type2 == IEEE80211_IF_TYPE_VLAN))); } static int ieee80211_master_open(struct net_device *dev) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/5] d80211: remove rate limit code
From: Elliot Schwartz <[EMAIL PROTECTED]> Remove unused and more or less pointless rate limiting code. This would have just dropped multicast frames arbitrarily when the limit is reached which is quite useless and does not really belong to 802.11 code. Signed-off-by: Elliot Schwartz <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -58,8 +58,8 @@ enum { PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001, PRISM2_PARAM_DROP_UNENCRYPTED = 1002, PRISM2_PARAM_PREAMBLE = 1003, - PRISM2_PARAM_RATE_LIMIT = 1004, - PRISM2_PARAM_RATE_LIMIT_BURST = 1005, + PRISM2_PARAM_RATE_LIMIT = 1004, /* no longer used */ + PRISM2_PARAM_RATE_LIMIT_BURST = 1005, /* no longer used */ PRISM2_PARAM_SHORT_SLOT_TIME = 1006, PRISM2_PARAM_TEST_MODE = 1007, PRISM2_PARAM_NEXT_MODE = 1008, Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -843,38 +843,6 @@ ieee80211_tx_h_misc(struct ieee80211_txr } -static void ieee80211_rate_limit(unsigned long data) -{ - struct ieee80211_local *local = (struct ieee80211_local *) data; - - if (local->rate_limit) { -local->rate_limit_bucket += local->rate_limit; -if (local->rate_limit_bucket > local->rate_limit_burst) -local->rate_limit_bucket = local->rate_limit_burst; - local->rate_limit_timer.expires = jiffies + HZ; - add_timer(&local->rate_limit_timer); - } -} - - -static ieee80211_txrx_result -ieee80211_tx_h_rate_limit(struct ieee80211_txrx_data *tx) -{ - - if (likely(!tx->local->rate_limit || tx->u.tx.unicast)) -return TXRX_CONTINUE; - - /* rate limit */ -if (tx->local->rate_limit_bucket) { -tx->local->rate_limit_bucket--; -return TXRX_CONTINUE; -} - - I802_DEBUG_INC(tx->local->tx_handlers_drop_rate_limit); - return TXRX_DROP; -} - - static ieee80211_txrx_result ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx) { @@ -4206,7 +4174,6 @@ static ieee80211_rx_handler ieee80211_rx static ieee80211_tx_handler ieee80211_tx_handlers[] = { - ieee80211_tx_h_rate_limit, ieee80211_tx_h_check_assoc, ieee80211_tx_h_ps_buf, ieee80211_tx_h_select_key, @@ -4369,9 +4336,6 @@ struct net_device *ieee80211_alloc_hw(si init_timer(&local->scan.timer); /* clear it out */ spin_lock_init(&local->generic_lock); - init_timer(&local->rate_limit_timer); - local->rate_limit_timer.function = ieee80211_rate_limit; - local->rate_limit_timer.data = (unsigned long) local; init_timer(&local->stat_timer); local->stat_timer.function = ieee80211_stat_refresh; local->stat_timer.data = (unsigned long) local; @@ -4582,8 +4546,6 @@ void ieee80211_unregister_hw(struct net_ } rtnl_unlock(); - if (local->rate_limit) - del_timer_sync(&local->rate_limit_timer); if (local->stat_time) del_timer_sync(&local->stat_timer); if (local->scan_work.data) { Index: wireless-dev/net/d80211/ieee80211_i.h === --- wireless-dev.orig/net/d80211/ieee80211_i.h +++ wireless-dev/net/d80211/ieee80211_i.h @@ -470,10 +470,6 @@ struct ieee80211_local { u32 stat_time; struct timer_list stat_timer; -struct timer_list rate_limit_timer; -u32 rate_limit; -u32 rate_limit_burst; -u32 rate_limit_bucket; struct proc_dir_entry *proc, *proc_sta, *proc_iface; struct work_struct sta_proc_add; @@ -493,7 +489,6 @@ struct ieee80211_local { unsigned int tx_handlers_drop_unencrypted; unsigned int tx_handlers_drop_fragment; unsigned int tx_handlers_drop_wep; - unsigned int tx_handlers_drop_rate_limit; unsigned int tx_handlers_drop_not_assoc; unsigned int tx_handlers_drop_unauth_port; unsigned int rx_handlers_drop; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -2405,25 +2405,6 @@ static int ieee80211_ioctl_prism2_param( local->short_preamble = value; break; - case PRISM2_PARAM_RATE_LIMIT_BURST: - local->rate_limit_burst = value; -local->rate_limit_bucket = value; - break; - - case PRISM2_PARAM_RATE_LIMIT: - /* number of packets (tokens) allowed per second */ - if (!local-
[patch 1/5] d80211: Fix overflow when creating AVS header
Fix overflow when converting timespec to microseconds. Without this patch you can get an overflow during the multiplication which can result in a negative number. hostime is define here: 4.4 hosttime The hosttime field is set to the current value of the host maintained clock variable when the frame is received. (from http://www.locustworld.com/tracker/getfile/prism2drivers/doc/capturefrm.txt) it is a u64. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -2573,7 +2573,7 @@ ieee80211_rx_mgmt(struct net_device *dev struct ieee80211_rate *rate; jiffies_to_timespec(status->hosttime, &ts); - fi->hosttime = cpu_to_be64(ts.tv_sec * 100 + + fi->hosttime = cpu_to_be64((u64) ts.tv_sec * 100 + ts.tv_nsec / 1000); fi->mactime = cpu_to_be64(status->mactime); switch (status->phymode) { -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/5] d80211: remove unused xr structure members, interface, etc.
From: Elliot Schwartz <[EMAIL PROTECTED]> This is all unused. Signed-off-by: Elliot Schwartz <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -82,7 +82,6 @@ struct ieee80211_hw_modes { struct ieee80211_channel *channels; int num_rates; struct ieee80211_rate *rates; - int xr_end; /* only used with Atheros XR */ }; struct ieee80211_tx_queue_params { @@ -166,8 +165,6 @@ struct ieee80211_tx_control { * transmission */ unsigned int fast_frame:1; - unsigned int atheros_xr:1; /* only used with Atheros XR */ - unsigned int power_level:8; /* per-packet transmit power level, in dBm */ unsigned int antenna_sel:4; /* 0 = default/diversity, @@ -193,7 +190,6 @@ struct ieee80211_tx_control { #define RX_FLAG_MMIC_ERROR 0x1 #define RX_FLAG_DECRYPTED0x2 -#define RX_FLAG_XR_DOUBLE_CHIRP 0x4 /* Receive status. The low-level driver should provide this information * (the subset supported by hardware) to the 802.11 code with each received @@ -276,8 +272,6 @@ struct ieee80211_conf { int atheros_super_ag_turbo_g; int atheros_super_ag_turbo_prime; - int atheros_xr; - /* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect; unsigned int spect_mgmt; @@ -679,9 +673,6 @@ struct ieee80211_hw { * needed only for IBSS mode and the result of this function is used to * determine whether to reply to Probe Requests. */ int (*tx_last_beacon)(struct net_device *dev); - - /* Optional handler for XR-in-use notification. */ - int (*atheros_xr_in_use)(struct net_device *dev, int in_use); }; /* Allocate a new hardware device. This must be called once for each Index: wireless-dev/include/net/d80211_mgmt.h === --- wireless-dev.orig/include/net/d80211_mgmt.h +++ wireless-dev/include/net/d80211_mgmt.h @@ -220,8 +220,4 @@ enum ieee80211_eid { WLAN_EID_QOS_PARAMETER = 222 }; - - -#define ATHEROS_INFO_USEXR BIT(3) - #endif /* D802_11_MGMT_H */ Index: wireless-dev/include/net/d80211_shared.h === --- wireless-dev.orig/include/net/d80211_shared.h +++ wireless-dev/include/net/d80211_shared.h @@ -21,8 +21,7 @@ enum { MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */, MODE_ATHEROS_PRIME = 5 /* Atheros Dynamic Turbo mode */, MODE_ATHEROS_PRIMEG = 6 /* Atheros Dynamic Turbo mode G */, - MODE_ATHEROS_XR = 7 /* Atheros XR mode */, - NUM_IEEE80211_MODES = 8 + NUM_IEEE80211_MODES = 7 }; #define IEEE80211_CHAN_W_SCAN 0x0001 @@ -40,7 +39,6 @@ enum { #define IEEE80211_RATE_CCK 0x0040 #define IEEE80211_RATE_TURBO 0x0080 #define IEEE80211_RATE_MANDATORY 0x0100 -#define IEEE80211_RATE_XR 0x0200 #define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2) #define IEEE80211_RATE_MODULATION(f) \ Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -186,7 +186,6 @@ struct prism2_hostapd_param { * IEEE80211_ATHEROS_SUPER_AG */ u8 atheros_super_ag; - u8 atheros_xr_mode; u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; Index: wireless-dev/net/d80211/ieee80211_sysfs_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sysfs_sta.c +++ wireless-dev/net/d80211/ieee80211_sysfs_sta.c @@ -77,7 +77,7 @@ STA_ATTR(wep_weak_iv_count, wep_weak_iv_ static ssize_t show_sta_flags(const struct sta_info *sta, char *buf) { - return sprintf(buf, "%s%s%s%s%s%s%s%s%s%s", + return sprintf(buf, "%s%s%s%s%s%s%s%s%s", sta->flags & WLAN_STA_AUTH ? "AUTH\n" : "", sta->flags & WLAN_STA_ASSOC ? "ASSOC\n" : "", sta->flags & WLAN_STA_PS ? "PS\n" : "", @@ -87,8 +87,7 @@ static ssize_t show_sta_flags(const stru sta->flags & WLAN_STA_SHORT_PREAMBLE ? "SHORT PREAMBLE\n" : "", sta->flags & WLAN_STA_WME ? "WME\n" : "", - sta->flags & WLAN_STA_WDS ? "WDS\n" : "", - sta->flags & WLAN_STA_XR ? "XR\n" : ""); + sta->flags & WLAN_STA_WDS ? "WDS\n" : ""); } __STA_ATTR(flags); Index: wireless-dev/net/d80211/sta_info.h ===
[patch 2/3] d80211: remove poorly documented ieee80211_hw extra_hdr_room flag
This flag is unused by all in tree drivers. Furthermore, the way that it is documented is not consistent with the way it is actually used by ieee80211.c. The original attempt appears to be something to do with adding extra header room for low-level drivers which need to pad the IEEE 802.11 header (example: Atheros). Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -476,10 +476,6 @@ struct ieee80211_hw { /* Force software encryption for TKIP packets if WMM is enabled. */ unsigned int no_tkip_wmm_hwaccel:1; - /* set if the payload needs to be padded at even boundaries after the -* header */ - unsigned int extra_hdr_room:1; - /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set * for such devices. The 'encryption' frame control bit is expected to Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -1551,7 +1551,7 @@ static int ieee80211_subif_start_xmit(st * build in headroom in __dev_alloc_skb() (linux/skbuff.h) and * alloc_skb() (net/core/skbuff.c) */ - head_need = hdrlen + encaps_len + (local->hw->extra_hdr_room ? 2 : 0); + head_need = hdrlen + encaps_len; head_need -= skb_headroom(skb); /* We are going to modify skb data, so make a copy of it if happens to Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2018,7 +2018,6 @@ static int __devinit adm8211_probe(struc hw->wep_include_iv = 1; hw->data_nullfunc_ack = 0; hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; hw->device_strips_mic = 0; hw->monitor_during_oper = 0; hw->fraglist = 0; Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -2578,7 +2578,6 @@ static int rt2400pci_init_hw(struct rt2x hw->wep_include_iv = 1; hw->data_nullfunc_ack = 1; hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; hw->device_strips_mic = 0; hw->monitor_during_oper = 1; hw->fraglist = 0; Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -2732,7 +2732,6 @@ static int rt2500pci_init_hw(struct rt2x hw->wep_include_iv = 1; hw->data_nullfunc_ack = 1; hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; hw->device_strips_mic = 0; hw->monitor_during_oper = 1; hw->fraglist = 0; Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500usb.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500usb.c @@ -2419,7 +2419,6 @@ static int rt2500usb_init_hw(struct rt2x hw->wep_include_iv = 1; hw->data_nullfunc_ack = 1; hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; hw->device_strips_mic = 0; hw->monitor_during_oper = 1; hw->fraglist = 0; Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt61pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt61pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt61pci.c @@ -3252,7 +3252,6 @@ static int rt61pci_init_hw(struct rt2x00 hw->wep_include_iv = 1; hw->data_nullfunc_ack = 1; hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; hw->device_strips_mic = 0; hw->monitor_during_oper = 1; hw->fraglist = 0; Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt73usb.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt73usb.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt73usb.c @@ -2792,7 +2792,6 @@ static int rt73usb_init_hw(struct rt2x00
[patch 1/3] d80211: use FCS_LEN instead of hardcoded number.
Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -451,7 +451,7 @@ ieee80211_tx_h_fragment(struct ieee80211 hdrlen = ieee80211_get_hdrlen(tx->fc); payload_len = first->len - hdrlen; - per_fragm = frag_threshold - hdrlen - 4 /* FCS */; + per_fragm = frag_threshold - hdrlen - FCS_LEN; num_fragm = (payload_len + per_fragm - 1) / per_fragm; frags = kzalloc(num_fragm * sizeof(struct sk_buff *), GFP_ATOMIC); @@ -1103,7 +1103,7 @@ __ieee80211_tx_prepare(struct ieee80211_ control->no_ack = is_multicast_ether_addr(hdr->addr1); tx->fragmented = local->fragmentation_threshold < IEEE80211_MAX_FRAG_THRESHOLD && tx->u.tx.unicast && - skb->len + 4 /* FCS */ > local->fragmentation_threshold && + skb->len + FCS_LEN > local->fragmentation_threshold && (!local->hw->set_frag_threshold); if (!tx->sta) control->clear_dst_mask = 1; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/3] d80211: silence sparse warning: bad constant expression
Sparse does not figure out that algs[] isn't really a variable length array. The message is: net/d80211/ieee80211_sta.c:934:12: error: bad constant expression This switches algs[] to be obviously a constant array, and derives the value of num_algs algs[]. The code is correct and equivalent with or without this change. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc printk(KERN_DEBUG "%s: AP denied authentication (auth_alg=%d " "code=%d)\n", dev->name, ifsta->auth_alg, status_code); if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { - const int num_algs = 3; - u8 algs[num_algs]; + u8 algs[3]; + const int num_algs = sizeof(algs) / sizeof(algs[0]); int i, pos; algs[0] = algs[1] = algs[2] = 0xff; if (ifsta->auth_algs & IEEE80211_AUTH_ALG_OPEN) -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: cfg80211 take 7
FYI, all three patches mentioned as possibly required by the nl80211 patchset in the header of nl80211.patch are already in wireless-dev: http://marc.theaimsgroup.com/?l=linux-netdev&m=115625436628696&w=2 (Introduces NLA_NUL_STRING) http://marc.theaimsgroup.com/?l=linux-netdev&m=115625168405439&w=2 (Convert existing NLA_STRING attributes to use the new validation features) http://marc.theaimsgroup.com/?l=linux-netdev&m=115650333420169&w=2 (remove value argument from NLA_PUT_FLAG) I also updated the patchset a bit to apply to current wireless-dev. I will send that to Johannes directly. On Fri, Oct 06, 2006 at 04:59:50PM +0200, Johannes Berg wrote: > Hah, take 6 was eaten by netdev (even the announcement) but it did reach > some people (and before those who did get it wonder: I resent to netdev, > the original mail was accidentally not addressed to netdev, so it's not > that I simply didn't send it). > > anyway, it's getting large, so... straight from quilt: > http://johannes.sipsolutions.net/files/cfg80211/ > > order is: > nl80211.patch > move-wext.patch > wext-compat.patch > > johannes > - > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 3/3] d80211: silence sparse warning: bad constant expression
Update to use ARRAY_SIZE, based on comment from Joe Perches. d80211: silence sparse warning: 'bad constant expression' Sparse does not figure out that algs[] isn't really a variable length array. The message is: net/d80211/ieee80211_sta.c:934:12: error: bad constant expression This switches algs[] to be obviously a constant array, and derives the value of num_algs algs[]. The code is correct and equivalent with or without this change. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211_sta.c === --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc printk(KERN_DEBUG "%s: AP denied authentication (auth_alg=%d " "code=%d)\n", dev->name, ifsta->auth_alg, status_code); if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { - const int num_algs = 3; - u8 algs[num_algs]; + u8 algs[3]; + const int num_algs = ARRAY_SIZE(algs); int i, pos; algs[0] = algs[1] = algs[2] = 0xff; if (ifsta->auth_algs & IEEE80211_AUTH_ALG_OPEN) - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 5/5] d80211: allow wireless vlan interface to havesameMAC an AP interface
On Tue, Oct 10, 2006 at 12:50:27PM +0200, Johannes Berg wrote: > On Mon, 2006-10-09 at 14:38 -0700, Jouni Malinen wrote: > > > Yes, I just merged in support for this (dynamic VLANs) into hostapd. > > RADIUS Access-Accept is used select VLAN is being used and the STA is > > bound at that point to another virtual interface, if needed. > > Different question. How do broadcasts to a vlan interface work? Are they > rewritten to unicasts to all vlan stations? no, still broadcasts, but in a typical deployment some for of encryption is used. Each vlan has a unique broadcast key so stations on one vlan cannot decrypt packets from another vlan. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 2/3] d80211: remove poorly documented ieee80211_hw extra_hdr_room flag
On Tue, Oct 10, 2006 at 12:00:12PM +0200, Michael Buesch wrote: > On Monday 09 October 2006 19:03, David Kimdon wrote: > > This flag is unused by all in tree drivers. Furthermore, the way that > > it is documented is not consistent with the way it is actually used by > > ieee80211.c. The original attempt appears to be something to do with > > adding extra header room for low-level drivers which need to pad the > > IEEE 802.11 header (example: Atheros). > > What about not removing it, but extending it. Sure, I would be happy with that. For Atheros it will be '2' to ensure that we can properly align the packet in the tx path without needing to realloc. > In the current form it's rather useless. But we could make extra_hdr_room > a value instead of a flag. Bcm43xx needs somewhere around 30bytes extra > header room. So every driver which does not need header room, sets this > to 0. Every other driver to the specific value. > > We currently workaround the problem by using an extra DMA descriptor > just for the header. That's not really a problem, though. But it means > a little bit of additional overhead in the TX path. Well. > > > Signed-off-by: David Kimdon <[EMAIL PROTECTED]> > > > > Index: wireless-dev/include/net/d80211.h > > === > > --- wireless-dev.orig/include/net/d80211.h > > +++ wireless-dev/include/net/d80211.h > > @@ -476,10 +476,6 @@ struct ieee80211_hw { > > /* Force software encryption for TKIP packets if WMM is enabled. */ > > unsigned int no_tkip_wmm_hwaccel:1; > > > > - /* set if the payload needs to be padded at even boundaries after the > > -* header */ > > - unsigned int extra_hdr_room:1; > > - > > /* Some devices handle Michael MIC internally and do not include MIC in > > * the received packets passed up. device_strips_mic must be set > > * for such devices. The 'encryption' frame control bit is expected to > > Index: wireless-dev/net/d80211/ieee80211.c > > === > > --- wireless-dev.orig/net/d80211/ieee80211.c > > +++ wireless-dev/net/d80211/ieee80211.c > > @@ -1551,7 +1551,7 @@ static int ieee80211_subif_start_xmit(st > > * build in headroom in __dev_alloc_skb() (linux/skbuff.h) and > > * alloc_skb() (net/core/skbuff.c) > > */ > > - head_need = hdrlen + encaps_len + (local->hw->extra_hdr_room ? 2 : 0); > > + head_need = hdrlen + encaps_len; > > head_need -= skb_headroom(skb); > > > > /* We are going to modify skb data, so make a copy of it if happens to > > Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c > > === > > --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c > > +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c > > @@ -2018,7 +2018,6 @@ static int __devinit adm8211_probe(struc > > hw->wep_include_iv = 1; > > hw->data_nullfunc_ack = 0; > > hw->no_tkip_wmm_hwaccel = 1; > > - hw->extra_hdr_room = 0; > > hw->device_strips_mic = 0; > > hw->monitor_during_oper = 0; > > hw->fraglist = 0; > > Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c > > === > > --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c > > +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c > > @@ -2578,7 +2578,6 @@ static int rt2400pci_init_hw(struct rt2x > > hw->wep_include_iv = 1; > > hw->data_nullfunc_ack = 1; > > hw->no_tkip_wmm_hwaccel = 1; > > - hw->extra_hdr_room = 0; > > hw->device_strips_mic = 0; > > hw->monitor_during_oper = 1; > > hw->fraglist = 0; > > Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c > > === > > --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c > > +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c > > @@ -2732,7 +2732,6 @@ static int rt2500pci_init_hw(struct rt2x > > hw->wep_include_iv = 1; > > hw->data_nullfunc_ack = 1; > > hw->no_tkip_wmm_hwaccel = 1; > > - hw->extra_hdr_room = 0; > > hw->device_strips_mic = 0; > > hw->monitor_during_oper = 1; > > hw->fraglist = 0; > > Index: wireless-dev/drivers/net/wireless/d80211/rt2x
Re: [patch 2/3] d80211: remove poorly documented ieee80211_hw extra_hdr_room flag
On Tue, Oct 10, 2006 at 11:04:05PM +0200, Michael Buesch wrote: > On Tuesday 10 October 2006 15:45, David Kimdon wrote: > > On Tue, Oct 10, 2006 at 12:00:12PM +0200, Michael Buesch wrote: > > > On Monday 09 October 2006 19:03, David Kimdon wrote: > > > > This flag is unused by all in tree drivers. Furthermore, the way that > > > > it is documented is not consistent with the way it is actually used by > > > > ieee80211.c. The original attempt appears to be something to do with > > > > adding extra header room for low-level drivers which need to pad the > > > > IEEE 802.11 header (example: Atheros). > > > > > > What about not removing it, but extending it. > > > > Sure, I would be happy with that. For Atheros it will be '2' to > > ensure that we can properly align the packet in the tx path without > > needing to realloc. > > Ok, nice. Do you want to do a patch or should I do? Go ahead, thanks. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: extend extra_hdr_room to be a bytecount
Perhaps rename it to extra_tx_headroom? - existing users would then need to take notice of the change - the name 'extra_tx_headroom' is more descriptive of what it actually is -David On Wed, Oct 11, 2006 at 11:58:28AM +0200, Michael Buesch wrote: > Extend ieee80211_hw's extra_hdr_room to be a bytecount for > a device specific TX header instead of being a hardcoded > 0/2 byte choice. > > Signed-off-by: Michael Buesch <[EMAIL PROTECTED]> > > diff --git a/include/net/d80211.h b/include/net/d80211.h > index a80f48b..9e9709f 100644 > --- a/include/net/d80211.h > +++ b/include/net/d80211.h > @@ -476,10 +476,6 @@ struct ieee80211_hw { > /* Force software encryption for TKIP packets if WMM is enabled. */ > unsigned int no_tkip_wmm_hwaccel:1; > > - /* set if the payload needs to be padded at even boundaries after the > - * header */ > - unsigned int extra_hdr_room:1; > - > /* Some devices handle Michael MIC internally and do not include MIC in >* the received packets passed up. device_strips_mic must be set >* for such devices. The 'encryption' frame control bit is expected to > @@ -496,6 +492,9 @@ struct ieee80211_hw { >* i.e. more than one skb per frame */ > unsigned int fraglist:1; > > + /* Set to the size of a needed device specific skb headroom for TX > skbs. */ > + unsigned int extra_hdr_room; > + > /* This is the time in us to change channels > */ > int channel_change_time; > diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c > index 1ef2707..7d52c3b 100644 > --- a/net/d80211/ieee80211.c > +++ b/net/d80211/ieee80211.c > @@ -1551,7 +1551,7 @@ static int ieee80211_subif_start_xmit(st >* build in headroom in __dev_alloc_skb() (linux/skbuff.h) and >* alloc_skb() (net/core/skbuff.c) >*/ > - head_need = hdrlen + encaps_len + (local->hw->extra_hdr_room ? 2 : 0); > + head_need = hdrlen + encaps_len + local->hw->extra_hdr_room; > head_need -= skb_headroom(skb); > > /* We are going to modify skb data, so make a copy of it if happens to > > > -- > Greetings Michael. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -143,23 +143,30 @@ struct ieee80211_tx_control { * specific value for the rate (from * struct ieee80211_rate) */ /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; + u8 retry_limit; /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ + u16 rts_cts_duration; + +#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(1<<2) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(1<<3) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(1<<5) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) +#define IEEE80211_TXCTL_REQUEUE(1<<7) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of + * the frame */ + u32 flags; /* tx control flags defined + * above */ + /* following three flags are only used with Atheros Super A/G */ unsigned int compress:1; unsigned int turbo_prime_notify:1; /* notify HostAPd after frame @@ -168,18 +175,16 @@ struct ieee80211_tx_control { unsigned int atheros_xr:1; /* only used with Atheros XR */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, >= 0 keyidx from hw->set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw->queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, >= 0 keyidx from +* hw->set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw->queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /*
[patch 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2014,17 +2014,9 @@ static int __devinit adm8211_probe(struc hw->version = 2; hw->name = "adm8211"; - hw->host_gen_beacon = 0; - hw->device_hides_wep = 0; - hw->rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw->host_broadcast_ps_buffering = 0; - hw->wep_include_iv = 1; - hw->data_nullfunc_ack = 0; - hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; - hw->device_strips_mic = 0; - hw->monitor_during_oper = 0; - hw->fraglist = 0; + hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw->channel_change_time = 1000; hw->num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -460,19 +460,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -480,18 +480,19 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) /* set if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; +#define IEEE80211_HW_EXTRA_HDR_ROOM (1<<8) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -499,15 +500,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<9) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (1<<10) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (1<<11) + + u32 flags; /* hardware flags defined above */ /* This is the time in us to change channels */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wire
[patch 3/5] d80211: remove bitfields from ieee80211_key_conf
All three one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_KEY_* definitions. The 8 bit keyidx bitfield is converted to type s8. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3634,8 +3634,8 @@ static int bcm43xx_net_set_key(struct ne if (err) goto out_unlock; key->hw_key_idx = index; - key->force_sw_encrypt = 0; - if (key->default_tx_key) + key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT; + if (key->flags & IEEE80211_KEY_DEFAULT_TX_KEY) bcm->default_key_idx = index; bcm->key[index].enabled = 1; break; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -389,13 +389,19 @@ struct ieee80211_key_conf { ieee80211_key_alg alg; int keylen; - unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ - int keyidx:8; /* WEP key index */ - unsigned int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ - unsigned int default_wep_only:1;/* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ +#define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level +driver */ +#define IEEE80211_KEY_DEFAULT_TX_KEY (1<<1) /* This key is the new default TX +key (used only for broadcast +keys). */ +#define IEEE80211_KEY_DEFAULT_WEP_ONLY (1<<2) /* static WEP is the only +configured security policy; +this allows some low-level +drivers to determine when +hwaccel can be used */ + u32 flags; /* key configuration flags defined above */ + + s8 keyidx; /* WEP key index */ u8 key[0]; }; Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -74,10 +74,14 @@ ieee80211_key_data2conf(struct ieee80211 conf->hw_key_idx = data->hw_key_idx; conf->alg = data->alg; conf->keylen = data->keylen; - conf->force_sw_encrypt = data->force_sw_encrypt; + conf->flags = 0; + if (data->force_sw_encrypt) + conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; conf->keyidx = data->keyidx; - conf->default_tx_key = data->default_tx_key; - conf->default_wep_only = local->default_wep_only; + if (data->default_tx_key) + conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY; + if (local->default_wep_only) + conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY; memcpy(conf->key, data->key, data->keylen); return conf; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -326,7 +326,7 @@ static int ieee80211_ioctl_add_sta(struc memset(&conf, 0, sizeof(conf)); conf.hw_key_idx = HW_KEY_IDX_INVALID; conf.alg = ALG_NULL; - conf.force_sw_encrypt = 1; + conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; if (local->hw->set_key(dev, SET_KEY, sta->addr, &conf, sta->aid)) { sta->key_idx_compression = HW_KEY_IDX_INVALID; @@ -496,7 +496,7 @@ int ieee80211_set_hw_encryption(struct n key->hw_key_idx = HW_KEY_IDX_INVALID; } else { key->force_sw_encrypt = - keyconf->force_sw_encrypt; + !!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT); key->hw_key_idx =
[patch 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -254,12 +254,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (1<<0) +#define IEEE80211_CONF_SW_DECRYPT (1<<1) +#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3531,9 +3531,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf->short_slot_time != bcm->short_slot) { + if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) { assert(phy->type == BCM43xx_PHYTYPE_G); - if (conf->short_slot_time) + if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3546,7 +3546,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf->ssid_hidden) { + if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2081,7 +2082,8 @@ static int rt2400pci_config(struct net_d conf->channel_val, conf->channel, conf->freq); rt2400pci_config_txpower(rt2x00dev, conf->power_level); rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf->short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf->phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2231,7 +2232,8 @@ static int rt2500pci_config(struct net_d conf->power_level); rt2500pci_config_txpower(rt2x00dev, conf->power_level); rt2500pci_config_antenna(rt2x00d
[patch 0/5] d80211.h bitfield removal
Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h (except for the xr and Super A/G fields which are completely removed by previous patches). I converted the 1 bit bitfields into a bit in a u32 flags structure member. Larger bitfields I converted into their u8/u16/whatever equivalent. This should be a no-op from a functionality standpoint. -David -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/5] d80211: remove bitfields from ieee80211_tx_status
Both one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TX_STATUS_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -222,8 +222,10 @@ struct ieee80211_tx_status { /* copied ieee80211_tx_control structure */ struct ieee80211_tx_control control; - unsigned int tx_filtered:1; - unsigned int ack:1; /* whether the TX frame was ACKed */ +#define IEEE80211_TX_STATUS_TX_FILTERED(1<<0) +#define IEEE80211_TX_STATUS_ACK(1<<1) /* whether the TX frame was ACKed */ + u32 flags; /* tx staus flags defined above */ + int ack_signal; /* measured signal strength of the ACK frame */ int excessive_retries; int retry_count; Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -427,12 +427,14 @@ static void adm8211_interrupt_tci(struct if (status & TDES0_STATUS_ES) { stats->tx_errors++; - priv->tx_buffers[entry].tx_status.ack = 0; + priv->tx_buffers[entry].tx_status.flags &= + ~IEEE80211_TX_STATUS_ACK; if (status & (TDES0_STATUS_TUF | TDES0_STATUS_TRO)) stats->tx_fifo_errors++; } else - priv->tx_buffers[entry].tx_status.ack = 1; + priv->tx_buffers[entry].tx_status.flags |= + IEEE80211_TX_STATUS_ACK; pci_unmap_single(priv->pdev, priv->tx_buffers[entry].mapping, priv->tx_buffers[entry].skb->len, PCI_DMA_TODEVICE); Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -1079,7 +1079,10 @@ void bcm43xx_dma_handle_xmitstatus(struc * status of the transmission. * Some fields of txstat are already filled in dma_tx(). */ - meta->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; + else + meta->txstat.flags &= ~IEEE80211_TX_STATUS_ACK; meta->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, &(meta->txstat)); /* skb is freed by ieee80211_tx_status_irqsafe() */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -477,7 +477,10 @@ void bcm43xx_pio_handle_xmitstatus(struc queue->tx_devq_packets--; queue->tx_devq_used -= (packet->skb->len + sizeof(struct bcm43xx_txhdr)); - packet->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; + else + packet->txstat.flags &= ~IEEE80211_TX_STATUS_ACK; packet->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, packet->skb, &(packet->txstat)); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1741,10 +1741,11 @@ static void rt2400pci_txdone(void *data) ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK); + entry->tx_status.flags = 0; /* -* TODO: How can te below field be set correctly? +* TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of +* entry->tx_status.flags be set correctly?
[patch] d80211: remove initialization of unused xr structure members
The structure member xr_end was removed from d80211.h. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -2704,11 +2704,6 @@ static int rt2400pci_init_hw_modes(struc rt2400pci_init_hw_channels(rt2x00dev, hw->modes->channels); rt2400pci_init_hw_rates(rt2x00dev, hw->modes->rates); - /* -* xr_end is only used on Atheros cards. -*/ - hw->modes->xr_end = 0; - return ieee80211_update_hw(net_dev, hw); exit_free_channels: Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -2989,11 +2989,6 @@ static int rt2500pci_init_hw_modes(struc rt2500pci_init_hw_channels(rt2x00dev, hw->modes[0].channels); rt2500pci_init_hw_rates(rt2x00dev, hw->modes[0].rates); - /* -* xr_end is only used on Atheros cards. -*/ - hw->modes->xr_end = 0; - return ieee80211_update_hw(net_dev, hw); exit_free_channels: Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt61pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt61pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt61pci.c @@ -3501,11 +3501,6 @@ static int rt61pci_init_hw_modes(struct rt61pci_init_hw_channels(rt2x00dev, hw->modes[0].channels); rt61pci_init_hw_rates(rt2x00dev, hw->modes[0].rates); - /* -* xr_end is only used on Atheros cards. -*/ - hw->modes->xr_end = 0; - return ieee80211_update_hw(net_dev, hw); exit_free_channels: -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] d80211: remove unused Super AG definitions, purge comment
Remove unused Super AG structure members, enums. In struct ieee80211_tx_status the queue_length and queue_number could be useful outside the context of Super AG, so remove the comment and leave the members. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -159,12 +159,6 @@ struct ieee80211_tx_control { unsigned int requeue:1; unsigned int first_fragment:1; /* This is a first fragment of the * frame */ -/* following three flags are only used with Atheros Super A/G */ - unsigned int compress:1; - unsigned int turbo_prime_notify:1; /* notify HostAPd after frame - * transmission */ - unsigned int fast_frame:1; - unsigned int power_level:8; /* per-packet transmit power level, in dBm */ unsigned int antenna_sel:4; /* 0 = default/diversity, @@ -219,7 +213,6 @@ struct ieee80211_tx_status { int excessive_retries; int retry_count; - /* following two fields are only used with Atheros Super A/G */ int queue_length; /* information about TX queue */ int queue_number; }; @@ -265,13 +258,6 @@ struct ieee80211_conf { int antenna_def; int antenna_mode; - int atheros_super_ag_compression; - int atheros_super_ag_fast_frame; - int atheros_super_ag_burst; - int atheros_super_ag_wme_ele; - int atheros_super_ag_turbo_g; - int atheros_super_ag_turbo_prime; - /* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect; unsigned int spect_mgmt; Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -182,10 +182,6 @@ struct prism2_hostapd_param { u16 aid; u16 capability; u8 supp_rates[32]; - /* atheros_super_ag and enc_flags are only used with -* IEEE80211_ATHEROS_SUPER_AG -*/ - u8 atheros_super_ag; u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; Index: wireless-dev/include/net/d80211_shared.h === --- wireless-dev.orig/include/net/d80211_shared.h +++ wireless-dev/include/net/d80211_shared.h @@ -19,8 +19,6 @@ enum { MODE_ATHEROS_TURBO = 2 /* Atheros Turbo mode (2x.11a at 5 GHz) */, MODE_IEEE80211G = 3 /* IEEE 802.11g (and 802.11b compatibility) */, MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */, - MODE_ATHEROS_PRIME = 5 /* Atheros Dynamic Turbo mode */, - MODE_ATHEROS_PRIMEG = 6 /* Atheros Dynamic Turbo mode G */, NUM_IEEE80211_MODES = 7 }; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] d80211: remove unused Super AG definitions, purgecomment
On Tue, Oct 17, 2006 at 08:59:13AM +0200, Johannes Berg wrote: > On Mon, 2006-10-16 at 11:39 -0700, David Kimdon wrote: > You want to adjust that last constant there too, I guess. Indeed, updated patch inline. > Why is it an > enum anyway if things are assigned statically? I don't have a good answer for that. -David Remove unused Super AG structure members, enums. In struct ieee80211_tx_status the queue_length and queue_number could be useful outside the context of Super AG, so remove the comment and leave the members. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -159,12 +159,6 @@ struct ieee80211_tx_control { unsigned int requeue:1; unsigned int first_fragment:1; /* This is a first fragment of the * frame */ -/* following three flags are only used with Atheros Super A/G */ - unsigned int compress:1; - unsigned int turbo_prime_notify:1; /* notify HostAPd after frame - * transmission */ - unsigned int fast_frame:1; - unsigned int power_level:8; /* per-packet transmit power level, in dBm */ unsigned int antenna_sel:4; /* 0 = default/diversity, @@ -219,7 +213,6 @@ struct ieee80211_tx_status { int excessive_retries; int retry_count; - /* following two fields are only used with Atheros Super A/G */ int queue_length; /* information about TX queue */ int queue_number; }; @@ -265,13 +258,6 @@ struct ieee80211_conf { int antenna_def; int antenna_mode; - int atheros_super_ag_compression; - int atheros_super_ag_fast_frame; - int atheros_super_ag_burst; - int atheros_super_ag_wme_ele; - int atheros_super_ag_turbo_g; - int atheros_super_ag_turbo_prime; - /* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect; unsigned int spect_mgmt; Index: wireless-dev/net/d80211/hostapd_ioctl.h === --- wireless-dev.orig/net/d80211/hostapd_ioctl.h +++ wireless-dev/net/d80211/hostapd_ioctl.h @@ -182,10 +182,6 @@ struct prism2_hostapd_param { u16 aid; u16 capability; u8 supp_rates[32]; - /* atheros_super_ag and enc_flags are only used with -* IEEE80211_ATHEROS_SUPER_AG -*/ - u8 atheros_super_ag; u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; Index: wireless-dev/include/net/d80211_shared.h === --- wireless-dev.orig/include/net/d80211_shared.h +++ wireless-dev/include/net/d80211_shared.h @@ -19,9 +19,7 @@ enum { MODE_ATHEROS_TURBO = 2 /* Atheros Turbo mode (2x.11a at 5 GHz) */, MODE_IEEE80211G = 3 /* IEEE 802.11g (and 802.11b compatibility) */, MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */, - MODE_ATHEROS_PRIME = 5 /* Atheros Dynamic Turbo mode */, - MODE_ATHEROS_PRIMEG = 6 /* Atheros Dynamic Turbo mode G */, - NUM_IEEE80211_MODES = 7 + NUM_IEEE80211_MODES = 5 }; #define IEEE80211_CHAN_W_SCAN 0x0001 - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take1 0/5] d80211 patches
Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. I converted the 1 bit bitfields into a bit in a u32/u16 or u8 flags structure member. Larger bitfields I converted into their u8/u16/whatever equivalent. This should be a no-op from a functionality standpoint. All tests using gcc 4.1.2. The size of structures where bitfields were removed is identical patched and unpatched. All object text size is either slightly smaller after the patch, or unchanged (bss and data are all unchanged). With all d80211 drivers compiled in the patched vmlinux is 752 bytes smaller. Changes from take0: Update the patches to apply on top of the following patches: d80211: remove unused Super AG definitions, purge comment (http://marc.theaimsgroup.com/?l=linux-netdev&m=116102409931269&w=2) d80211: remove initialization of unused xr structure members (http://marc.theaimsgroup.com/?l=linux-netdev&m=116076811809305&w=4) d80211: remove unused xr structure members, interface, etc. (http://marc.theaimsgroup.com/?l=linux-netdev&m=115989929600617&w=4) For key_conf_bitfields.patch change the new flags member to u8 from u32. For tx_control_bitfields.patch move the rts_cts_duration and retry_limit members in ieee80211_tx_control to allow for smaller structure size and change the flags member from u32 to u16. For tx_status_bitfields.patch, in drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c and drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c note that ieee80211_tx_status is already zero'd, so the ack bit only needs to be set, not cleared. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take1 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -141,36 +141,38 @@ struct ieee80211_tx_control { int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw * specific value for the rate (from * struct ieee80211_rate) */ - /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; - /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, >= 0 keyidx from hw->set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw->queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + +#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(1<<2) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(1<<3) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(1<<5) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) +#define IEEE80211_TXCTL_REQUEUE(1<<7) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of + * the frame */ + u16 flags; /* tx control flags defined + * above */ + u16 rts_cts_duration; /* duration field for RTS/CTS frame */ + u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, >= 0 keyidx from +* hw->set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw->queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /* retry rate for the last retries, given as the Index: wireless-dev/net/d80211/ieee80211.c
Re: [patch 1/5] d80211: remove bitfields from ieee80211_tx_control
On Mon, Oct 16, 2006 at 06:07:25PM +0200, Michael Buesch wrote: > On Friday 13 October 2006 21:20, David Kimdon wrote: > > All one-bit bitfields have been subsumed into the new 'flags' > > structure member and the new IEEE80211_TXCTL_* definitions. The > > multiple bit members were converted to u8, s8 or u16 as appropriate. I'll answer based on take1, which I just sent to the list. > > And, eh, did this increase or decrease the struct size? structure sizes did not change. > Does this generate better or worse code? It generates slightly smaller code with gcc 4.1.2. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take1 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -240,12 +240,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (1<<0) +#define IEEE80211_CONF_SW_DECRYPT (1<<1) +#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3531,9 +3531,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf->short_slot_time != bcm->short_slot) { + if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) { assert(phy->type == BCM43xx_PHYTYPE_G); - if (conf->short_slot_time) + if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3546,7 +3546,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf->ssid_hidden) { + if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2081,7 +2082,8 @@ static int rt2400pci_config(struct net_d conf->channel_val, conf->channel, conf->freq); rt2400pci_config_txpower(rt2x00dev, conf->power_level); rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf->short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf->phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2231,7 +2232,8 @@ static int rt2500pci_config(struct net_d conf->power_level); rt2500pci_config_txpower(rt2x00dev, conf->power_level); rt2500pci_config_antenna(rt2x00d
[take1 2/5] d80211: remove bitfields from ieee80211_tx_status
Both one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TX_STATUS_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -209,8 +209,10 @@ struct ieee80211_tx_status { /* copied ieee80211_tx_control structure */ struct ieee80211_tx_control control; - unsigned int tx_filtered:1; - unsigned int ack:1; /* whether the TX frame was ACKed */ +#define IEEE80211_TX_STATUS_TX_FILTERED(1<<0) +#define IEEE80211_TX_STATUS_ACK(1<<1) /* whether the TX frame was ACKed */ + u32 flags; /* tx staus flags defined above */ + int ack_signal; /* measured signal strength of the ACK frame */ int excessive_retries; int retry_count; Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -427,12 +427,14 @@ static void adm8211_interrupt_tci(struct if (status & TDES0_STATUS_ES) { stats->tx_errors++; - priv->tx_buffers[entry].tx_status.ack = 0; + priv->tx_buffers[entry].tx_status.flags &= + ~IEEE80211_TX_STATUS_ACK; if (status & (TDES0_STATUS_TUF | TDES0_STATUS_TRO)) stats->tx_fifo_errors++; } else - priv->tx_buffers[entry].tx_status.ack = 1; + priv->tx_buffers[entry].tx_status.flags |= + IEEE80211_TX_STATUS_ACK; pci_unmap_single(priv->pdev, priv->tx_buffers[entry].mapping, priv->tx_buffers[entry].skb->len, PCI_DMA_TODEVICE); Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -1079,7 +1079,8 @@ void bcm43xx_dma_handle_xmitstatus(struc * status of the transmission. * Some fields of txstat are already filled in dma_tx(). */ - meta->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; meta->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, &(meta->txstat)); /* skb is freed by ieee80211_tx_status_irqsafe() */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -477,7 +477,8 @@ void bcm43xx_pio_handle_xmitstatus(struc queue->tx_devq_packets--; queue->tx_devq_used -= (packet->skb->len + sizeof(struct bcm43xx_txhdr)); - packet->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; packet->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, packet->skb, &(packet->txstat)); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1741,10 +1741,11 @@ static void rt2400pci_txdone(void *data) ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK); + entry->tx_status.flags = 0; /* -* TODO: How can te below field be set correctly? +* TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of +* entry->tx_status.flags be set correctly? */ - entry->tx_status.tx_filtered = 0; entry->tx_status.queue_length = ring->stats.limit; entry->tx_status.queue_number = entry->tx_status.control.
[take1 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2014,17 +2014,9 @@ static int __devinit adm8211_probe(struc hw->version = 2; hw->name = "adm8211"; - hw->host_gen_beacon = 0; - hw->device_hides_wep = 0; - hw->rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw->host_broadcast_ps_buffering = 0; - hw->wep_include_iv = 1; - hw->data_nullfunc_ack = 0; - hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; - hw->device_strips_mic = 0; - hw->monitor_during_oper = 0; - hw->fraglist = 0; + hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw->channel_change_time = 1000; hw->num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -437,19 +437,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -457,18 +457,19 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) /* set if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; +#define IEEE80211_HW_EXTRA_HDR_ROOM (1<<8) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -476,15 +477,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<9) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (1<<10) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (1<<11) + + u32 flags; /* hardware flags defined above */ /* This is the time in us to change channels */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wire
[take1 3/5] d80211: remove bitfields from ieee80211_key_conf
All three one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_KEY_* definitions. The 8 bit keyidx bitfield is converted to type s8. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3634,8 +3634,8 @@ static int bcm43xx_net_set_key(struct ne if (err) goto out_unlock; key->hw_key_idx = index; - key->force_sw_encrypt = 0; - if (key->default_tx_key) + key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT; + if (key->flags & IEEE80211_KEY_DEFAULT_TX_KEY) bcm->default_key_idx = index; bcm->key[index].enabled = 1; break; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -366,13 +366,19 @@ struct ieee80211_key_conf { ieee80211_key_alg alg; int keylen; - unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ - int keyidx:8; /* WEP key index */ - unsigned int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ - unsigned int default_wep_only:1;/* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ +#define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level +driver */ +#define IEEE80211_KEY_DEFAULT_TX_KEY (1<<1) /* This key is the new default TX +key (used only for broadcast +keys). */ +#define IEEE80211_KEY_DEFAULT_WEP_ONLY (1<<2) /* static WEP is the only +configured security policy; +this allows some low-level +drivers to determine when +hwaccel can be used */ + u8 flags; /* key configuration flags defined above */ + + s8 keyidx; /* WEP key index */ u8 key[0]; }; Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -74,10 +74,14 @@ ieee80211_key_data2conf(struct ieee80211 conf->hw_key_idx = data->hw_key_idx; conf->alg = data->alg; conf->keylen = data->keylen; - conf->force_sw_encrypt = data->force_sw_encrypt; + conf->flags = 0; + if (data->force_sw_encrypt) + conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; conf->keyidx = data->keyidx; - conf->default_tx_key = data->default_tx_key; - conf->default_wep_only = local->default_wep_only; + if (data->default_tx_key) + conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY; + if (local->default_wep_only) + conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY; memcpy(conf->key, data->key, data->keylen); return conf; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -326,7 +326,7 @@ static int ieee80211_ioctl_add_sta(struc memset(&conf, 0, sizeof(conf)); conf.hw_key_idx = HW_KEY_IDX_INVALID; conf.alg = ALG_NULL; - conf.force_sw_encrypt = 1; + conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; if (local->hw->set_key(dev, SET_KEY, sta->addr, &conf, sta->aid)) { sta->key_idx_compression = HW_KEY_IDX_INVALID; @@ -496,7 +496,7 @@ int ieee80211_set_hw_encryption(struct n key->hw_key_idx = HW_KEY_IDX_INVALID; } else { key->force_sw_encrypt = - keyconf->force_sw_encrypt; + !!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT); key->hw_key_idx =
Re: [patch 1/5] d80211: remove bitfields from ieee80211_tx_control
I am not particularily attached to bitfields or no bitfields. I am interested in getting d80211 merged. Bitfields have been discussed as an important TODO. Perhaps this can serve as a starting point for discussion of the tasks to complete before d80211 is merged? On Mon, Oct 16, 2006 at 12:34:07PM -0700, Simon Barber wrote: > Removing the bitfields makes the code much harder to read and maintain. I agree that we end up with more characters in the file, the bitfield syntax is more concise. However, I don't find it 'much' harder to read or maintain, it is a matter of taste. > Here we are working around a problem with the compiler by making the > code ugly - rather than fixing the compiler. The compilers are getting > better and better (GCC 4 has much better handling of this type of > optimization) but the code will remain ugly for ever. Well at least as far as code size goes gcc 4.1.2 still produces slightly larger code with the bitfields. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
d80211: ANNOUNCE: DadWifi, a port of MadWifi to d80211
Hi, DadWifi is a port of MadWifi to the d80211 stack. It works now in managed and monitor mode, lightly tested. Any card supported by MadWifi should be supported by DadWifi [1]. This allows a large number of cards to now take advantage of the d80211 stack. DadWifi uses the same (binary only) hal as MadWifi and reuses much of the initialization, descriptor and interrupt processing code. There is a subversion repository and mailing list available [2] for those wishing to try it out or help with development. -David [1] : http://madwifi.org/wiki/Compatibility [2] : https://devicescape.org/projects/dadwifi/ - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 3/3] d80211: silence sparse warning: bad constant expression
On Wed, Oct 18, 2006 at 03:56:07PM +0200, Jiri Benc wrote: > On Mon, 9 Oct 2006 13:11:02 -0700, David Kimdon wrote: > > --- wireless-dev.orig/net/d80211/ieee80211_sta.c > > +++ wireless-dev/net/d80211/ieee80211_sta.c > > @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc > > printk(KERN_DEBUG "%s: AP denied authentication (auth_alg=%d " > >"code=%d)\n", dev->name, ifsta->auth_alg, status_code); > > if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { > > - const int num_algs = 3; > > - u8 algs[num_algs]; > > + u8 algs[3]; > > + const int num_algs = ARRAY_SIZE(algs); > > Wouldn't it be better just to use ARRAY_SIZE(algs) and get rid of > num_algs completely? I actually think the code reads slightly cleaner using num_algs, but don't have a strong preference. I'd be happy to make the change if removing num_algs is preferred. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [take1 0/5] d80211 patches
On Wed, Oct 18, 2006 at 06:01:31PM +0200, Jiri Benc wrote: > On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: > > Continue d80211 bitfield removal. In general, compilers have > > difficulty generating efficient code for bitfields. This patchset > > removes all bitfields from include/net/d80211.h. > > Thanks for the patches! At first I intended to ask you to split d80211 > and drivers parts of the patches, but your way is better I think - it > doesn't break git-bisect. > > John, if you agree with these patches, could you apply them after you > pull from my tree? hold that thought, I missed updating rt73usb.c and rt2500usb.c. New patchset on its way. > > Thanks, > > Jiri > > -- > Jiri Benc > SUSE Labs - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [take1 0/5] d80211 patches
On Wed, Oct 18, 2006 at 07:23:14PM +0200, Ivo van Doorn wrote: > On Wednesday 18 October 2006 19:20, David Kimdon wrote: > > On Wed, Oct 18, 2006 at 06:01:31PM +0200, Jiri Benc wrote: > > > On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: > > > > Continue d80211 bitfield removal. In general, compilers have > > > > difficulty generating efficient code for bitfields. This patchset > > > > removes all bitfields from include/net/d80211.h. > > > > > > Thanks for the patches! At first I intended to ask you to split d80211 > > > and drivers parts of the patches, but your way is better I think - it > > > doesn't break git-bisect. > > > > > > John, if you agree with these patches, could you apply them after you > > > pull from my tree? > > > > hold that thought, I missed updating rt73usb.c and rt2500usb.c. New > > patchset on its way. > > Hi, > > That patch was send 2 hours ago by me to this list. :) > "[PATCH] rt2x00: Remove xr_end references" > That patch only fixed rt2500usb and rt73usb, so it can be applied safely > after your patch to fix the rt2x00 PCI drivers. Sorry, to be clear, I am talking about the bitfield removal from d80211.h patches. Actually, your patch to remove the xr references from the usb drivers is what made me notice I had forgotten them from the bitfield removal patches. hmm, I have a bad subject to the first mail in my post, my posting script set the initial 0/5 message subject as 'd80211 patches', should probably be a bit more specific :-) -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take2 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -240,12 +240,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (1<<0) +#define IEEE80211_CONF_SW_DECRYPT (1<<1) +#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3531,9 +3531,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf->short_slot_time != bcm->short_slot) { + if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) { assert(phy->type == BCM43xx_PHYTYPE_G); - if (conf->short_slot_time) + if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3546,7 +3546,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf->ssid_hidden) { + if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2081,7 +2082,8 @@ static int rt2400pci_config(struct net_d conf->channel_val, conf->channel, conf->freq); rt2400pci_config_txpower(rt2x00dev, conf->power_level); rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf->short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf->phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2231,7 +2232,8 @@ static int rt2500pci_config(struct net_d conf->power_level); rt2500pci_config_txpower(rt2x00dev, conf->power_level); rt2500pci_config_antenna(rt2x00d
[take2 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2014,17 +2014,9 @@ static int __devinit adm8211_probe(struc hw->version = 2; hw->name = "adm8211"; - hw->host_gen_beacon = 0; - hw->device_hides_wep = 0; - hw->rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw->host_broadcast_ps_buffering = 0; - hw->wep_include_iv = 1; - hw->data_nullfunc_ack = 0; - hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; - hw->device_strips_mic = 0; - hw->monitor_during_oper = 0; - hw->fraglist = 0; + hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw->channel_change_time = 1000; hw->num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -437,19 +437,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -457,18 +457,19 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) /* set if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; +#define IEEE80211_HW_EXTRA_HDR_ROOM (1<<8) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -476,15 +477,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<9) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (1<<10) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (1<<11) + + u32 flags; /* hardware flags defined above */ /* This is the time in us to change channels */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wire
[take2 2/5] d80211: remove bitfields from ieee80211_tx_status
Both one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TX_STATUS_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -209,8 +209,10 @@ struct ieee80211_tx_status { /* copied ieee80211_tx_control structure */ struct ieee80211_tx_control control; - unsigned int tx_filtered:1; - unsigned int ack:1; /* whether the TX frame was ACKed */ +#define IEEE80211_TX_STATUS_TX_FILTERED(1<<0) +#define IEEE80211_TX_STATUS_ACK(1<<1) /* whether the TX frame was ACKed */ + u32 flags; /* tx staus flags defined above */ + int ack_signal; /* measured signal strength of the ACK frame */ int excessive_retries; int retry_count; Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -427,12 +427,14 @@ static void adm8211_interrupt_tci(struct if (status & TDES0_STATUS_ES) { stats->tx_errors++; - priv->tx_buffers[entry].tx_status.ack = 0; + priv->tx_buffers[entry].tx_status.flags &= + ~IEEE80211_TX_STATUS_ACK; if (status & (TDES0_STATUS_TUF | TDES0_STATUS_TRO)) stats->tx_fifo_errors++; } else - priv->tx_buffers[entry].tx_status.ack = 1; + priv->tx_buffers[entry].tx_status.flags |= + IEEE80211_TX_STATUS_ACK; pci_unmap_single(priv->pdev, priv->tx_buffers[entry].mapping, priv->tx_buffers[entry].skb->len, PCI_DMA_TODEVICE); Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -1079,7 +1079,8 @@ void bcm43xx_dma_handle_xmitstatus(struc * status of the transmission. * Some fields of txstat are already filled in dma_tx(). */ - meta->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; meta->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, &(meta->txstat)); /* skb is freed by ieee80211_tx_status_irqsafe() */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -477,7 +477,8 @@ void bcm43xx_pio_handle_xmitstatus(struc queue->tx_devq_packets--; queue->tx_devq_used -= (packet->skb->len + sizeof(struct bcm43xx_txhdr)); - packet->txstat.ack = !!(status->flags & BCM43xx_TXSTAT_FLAG_ACK); + if (status->flags & BCM43xx_TXSTAT_FLAG_ACK) + packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; packet->txstat.retry_count = status->cnt2 - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, packet->skb, &(packet->txstat)); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1741,10 +1741,11 @@ static void rt2400pci_txdone(void *data) ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK); + entry->tx_status.flags = 0; /* -* TODO: How can te below field be set correctly? +* TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of +* entry->tx_status.flags be set correctly? */ - entry->tx_status.tx_filtered = 0; entry->tx_status.queue_length = ring->stats.limit; entry->tx_status.queue_number = entry->tx_status.control.
[take2 3/5] d80211: remove bitfields from ieee80211_key_conf
All three one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_KEY_* definitions. The 8 bit keyidx bitfield is converted to type s8. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3634,8 +3634,8 @@ static int bcm43xx_net_set_key(struct ne if (err) goto out_unlock; key->hw_key_idx = index; - key->force_sw_encrypt = 0; - if (key->default_tx_key) + key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT; + if (key->flags & IEEE80211_KEY_DEFAULT_TX_KEY) bcm->default_key_idx = index; bcm->key[index].enabled = 1; break; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -366,13 +366,19 @@ struct ieee80211_key_conf { ieee80211_key_alg alg; int keylen; - unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ - int keyidx:8; /* WEP key index */ - unsigned int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ - unsigned int default_wep_only:1;/* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ +#define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level +driver */ +#define IEEE80211_KEY_DEFAULT_TX_KEY (1<<1) /* This key is the new default TX +key (used only for broadcast +keys). */ +#define IEEE80211_KEY_DEFAULT_WEP_ONLY (1<<2) /* static WEP is the only +configured security policy; +this allows some low-level +drivers to determine when +hwaccel can be used */ + u8 flags; /* key configuration flags defined above */ + + s8 keyidx; /* WEP key index */ u8 key[0]; }; Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -74,10 +74,14 @@ ieee80211_key_data2conf(struct ieee80211 conf->hw_key_idx = data->hw_key_idx; conf->alg = data->alg; conf->keylen = data->keylen; - conf->force_sw_encrypt = data->force_sw_encrypt; + conf->flags = 0; + if (data->force_sw_encrypt) + conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; conf->keyidx = data->keyidx; - conf->default_tx_key = data->default_tx_key; - conf->default_wep_only = local->default_wep_only; + if (data->default_tx_key) + conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY; + if (local->default_wep_only) + conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY; memcpy(conf->key, data->key, data->keylen); return conf; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -326,7 +326,7 @@ static int ieee80211_ioctl_add_sta(struc memset(&conf, 0, sizeof(conf)); conf.hw_key_idx = HW_KEY_IDX_INVALID; conf.alg = ALG_NULL; - conf.force_sw_encrypt = 1; + conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; if (local->hw->set_key(dev, SET_KEY, sta->addr, &conf, sta->aid)) { sta->key_idx_compression = HW_KEY_IDX_INVALID; @@ -496,7 +496,7 @@ int ieee80211_set_hw_encryption(struct n key->hw_key_idx = HW_KEY_IDX_INVALID; } else { key->force_sw_encrypt = - keyconf->force_sw_encrypt; + !!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT); key->hw_key_idx =
[take2 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -141,36 +141,38 @@ struct ieee80211_tx_control { int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw * specific value for the rate (from * struct ieee80211_rate) */ - /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; - /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, >= 0 keyidx from hw->set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw->queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + +#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(1<<2) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(1<<3) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(1<<5) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) +#define IEEE80211_TXCTL_REQUEUE(1<<7) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of + * the frame */ + u16 flags; /* tx control flags defined + * above */ + u16 rts_cts_duration; /* duration field for RTS/CTS frame */ + u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, >= 0 keyidx from +* hw->set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw->queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /* retry rate for the last retries, given as the Index: wireless-dev/net/d80211/ieee80211.c
[take2 0/5] d80211: remove bitfields from include/net/d80211.h
Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. I converted the 1 bit bitfields into a bit in a u32/u16 or u8 flags structure member. Larger bitfields I converted into their u8/u16/whatever equivalent. This should be a no-op from a functionality standpoint. All tests using gcc 4.1.2. The size of structures where bitfields were removed is identical patched and unpatched. All object text size is either slightly smaller after the patch, or unchanged (bss and data are all unchanged). With all d80211 drivers compiled in the patched vmlinux is 928 bytes smaller. Changes from take1: Update rt2500usb.c and rt73usb.c drivers based on the new structures. Changes from take0: Update the patches to apply on top of the following patches: d80211: remove unused Super AG definitions, purge comment (http://marc.theaimsgroup.com/?l=linux-netdev&m=116102409931269&w=2) d80211: remove initialization of unused xr structure members (http://marc.theaimsgroup.com/?l=linux-netdev&m=116076811809305&w=4) d80211: remove unused xr structure members, interface, etc. (http://marc.theaimsgroup.com/?l=linux-netdev&m=115989929600617&w=4) For key_conf_bitfields.patch change the new flags member to u8 from u32. For tx_control_bitfields.patch move the rts_cts_duration and retry_limit members in ieee80211_tx_control to allow for smaller structure size and change the flags member from u32 to u16. For tx_status_bitfields.patch, in drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c and drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c note that ieee80211_tx_status is already zero'd, so the ack bit only needs to be set, not cleared. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: fix kernel doc for ieee80211_get_buffered_bc
ieee80211_beacon_get() was already described. The doc entry in question describes ieee80211_get_buffered_bc(). Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -782,7 +782,7 @@ struct sk_buff * ieee80211_beacon_get(st struct ieee80211_tx_control *control); /** - * ieee80211_beacon_get - accessing buffered broadcast and multicast frames + * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames * @dev: pointer to &struct net_device as obtained from * ieee80211_alloc_hw(). * @if_id: interface ID from &struct ieee80211_if_init_conf. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 1/2]d80211: hardware TKIP support for ipw3945
On Mon, Oct 23, 2006 at 02:40:28PM +0200, Jiri Benc wrote: > On Fri, 20 Oct 2006 17:19:36 +0800, Hong Liu wrote: > > --- a/include/net/d80211.h > > +++ b/include/net/d80211.h > > @@ -176,6 +176,7 @@ struct ieee80211_tx_control { > > */ > > int icv_len:8; /* Length of the ICV/MIC field in octets */ > > int iv_len:8; /* Length of the IV field in octets */ > > + u8 rc4key[16]; /* generated RC4 key for hw TKIP */ > > I don't like extending ieee80211_tx_control by 16 more bytes. The > driver is required to store a copy of each ieee80211_tx_control > (because it's copied to ieee80211_tx_status). I don't have a better > idea, though. Anybody? We could be more selective about what the driver is required to return in ieee80211_tx_status, the rc4key isn't particularily interesting to ieee80211_tx_status(). I expect there are other uninteresting fields (tx_rate, rts_cts_rate, come to mind, for example). We could put the fields we are interested in directly in ieee80211_tx_status, or have a new structure rather than re-using ieee80211_tx_control inside ieee80211_tx_status. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] [PATCH 3/3] Kconfig update for regulatory domain
This last chunk is broken: . . . Hunk #2 FAILED at 90. > --- wireless-dev-old/net/d80211/Kconfig 2006-10-23 13:56:11.0 > -0400 > +++ wireless-dev/net/d80211/Kconfig 2006-10-23 17:04:12.0 -0400 > @@ -16,8 +90,6 @@ config D80211_LEDS > This option enables a few LED triggers for different > packet receive/transmit events. > > -config D80211_ > - > config D80211_DEBUG > bool "Enable debugging output" > depends on D80211 - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] [PATCH 0/3] Add Regulatory Domain support to d80211
Hi, > The following patches extend 802.11 regulatory domain support of the > d80211 wireless stack through two modules: > > 1. ieee80211_regdomains > 2. iso3166-1 I am glad to see this work, this is something that we need a solution for. I do wonder if we can push most of this out of the kernel and into userspace. We could hard code a single set of constraints in the kernel which may be used world wide (802.11b channels 1-11, is that allowed everywhere?). Then we have a userspace tool which passes updated regulatory information into the kernel based on the user's country input. -David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
d80211: remove unused variable in ieee80211_rx_irqsafe
tmp is unused. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -3843,7 +3843,7 @@ void ieee80211_rx_irqsafe(struct net_dev struct ieee80211_rx_status *status) { struct ieee80211_local *local = dev->ieee80211_ptr; - struct ieee80211_rx_status *saved, *tmp; + struct ieee80211_rx_status *saved; skb->dev = dev; saved = kmalloc(sizeof(struct ieee80211_rx_status), GFP_ATOMIC); -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take3 3/5] d80211: remove bitfields from ieee80211_key_conf
All three one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_KEY_* definitions. The 8 bit keyidx bitfield is converted to type s8. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3583,8 +3583,8 @@ static int bcm43xx_net_set_key(struct ne if (err) goto out_unlock; key->hw_key_idx = index; - key->force_sw_encrypt = 0; - if (key->default_tx_key) + key->flags &= ~IEEE80211_KEY_FORCE_SW_ENCRYPT; + if (key->flags & IEEE80211_KEY_DEFAULT_TX_KEY) bcm->default_key_idx = index; bcm->key[index].enabled = 1; break; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -366,13 +366,19 @@ struct ieee80211_key_conf { ieee80211_key_alg alg; int keylen; - unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ - int keyidx:8; /* WEP key index */ - unsigned int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ - unsigned int default_wep_only:1;/* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ +#define IEEE80211_KEY_FORCE_SW_ENCRYPT (1<<0) /* to be cleared by low-level +driver */ +#define IEEE80211_KEY_DEFAULT_TX_KEY (1<<1) /* This key is the new default TX +key (used only for broadcast +keys). */ +#define IEEE80211_KEY_DEFAULT_WEP_ONLY (1<<2) /* static WEP is the only +configured security policy; +this allows some low-level +drivers to determine when +hwaccel can be used */ + u8 flags; /* key configuration flags defined above */ + + s8 keyidx; /* WEP key index */ u8 key[0]; }; Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -64,10 +64,14 @@ ieee80211_key_data2conf(struct ieee80211 conf->hw_key_idx = data->hw_key_idx; conf->alg = data->alg; conf->keylen = data->keylen; - conf->force_sw_encrypt = data->force_sw_encrypt; + conf->flags = 0; + if (data->force_sw_encrypt) + conf->flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; conf->keyidx = data->keyidx; - conf->default_tx_key = data->default_tx_key; - conf->default_wep_only = local->default_wep_only; + if (data->default_tx_key) + conf->flags |= IEEE80211_KEY_DEFAULT_TX_KEY; + if (local->default_wep_only) + conf->flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY; memcpy(conf->key, data->key, data->keylen); return conf; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -331,7 +331,7 @@ static int ieee80211_ioctl_add_sta(struc memset(&conf, 0, sizeof(conf)); conf.hw_key_idx = HW_KEY_IDX_INVALID; conf.alg = ALG_NULL; - conf.force_sw_encrypt = 1; + conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; if (local->hw->set_key(dev, SET_KEY, sta->addr, &conf, sta->aid)) { sta->key_idx_compression = HW_KEY_IDX_INVALID; @@ -501,7 +501,7 @@ int ieee80211_set_hw_encryption(struct n key->hw_key_idx = HW_KEY_IDX_INVALID; } else { key->force_sw_encrypt = - keyconf->force_sw_encrypt; + !!(keyconf->flags & IEEE80211_KEY_FORCE_SW_ENCRYPT); key->hw_key_idx =
[take3 0/5] d80211: remove bitfields from include/net/d80211.h
Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. I converted the 1 bit bitfields into a bit in a u32/u16 or u8 flags structure member. Larger bitfields I converted into their u8/u16/whatever equivalent. This should be a no-op from a functionality standpoint. All tests using gcc 4.1.2. The size of structures where bitfields were removed is identical patched and unpatched. All object text size is either slightly smaller after the patch, or unchanged (bss and data are all unchanged). With all d80211 drivers compiled in the patched vmlinux is 1232 bytes smaller. Changes from take2: Refresh to apply to current wireless-dev. Changes from take1: Update rt2500usb.c and rt73usb.c drivers based on the new structures. Changes from take0: Update the patches to apply on top of the following patches: d80211: remove unused Super AG definitions, purge comment (http://marc.theaimsgroup.com/?l=linux-netdev&m=116102409931269&w=2) d80211: remove initialization of unused xr structure members (http://marc.theaimsgroup.com/?l=linux-netdev&m=116076811809305&w=4) d80211: remove unused xr structure members, interface, etc. (http://marc.theaimsgroup.com/?l=linux-netdev&m=115989929600617&w=4) For key_conf_bitfields.patch change the new flags member to u8 from u32. For tx_control_bitfields.patch move the rts_cts_duration and retry_limit members in ieee80211_tx_control to allow for smaller structure size and change the flags member from u32 to u16. For tx_status_bitfields.patch, in drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c and drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c note that ieee80211_tx_status is already zero'd, so the ack bit only needs to be set, not cleared. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take3 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -141,36 +141,38 @@ struct ieee80211_tx_control { int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw * specific value for the rate (from * struct ieee80211_rate) */ - /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; - /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, >= 0 keyidx from hw->set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw->queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + +#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(1<<2) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(1<<3) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(1<<5) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) +#define IEEE80211_TXCTL_REQUEUE(1<<7) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of + * the frame */ + u16 flags; /* tx control flags defined + * above */ + u16 rts_cts_duration; /* duration field for RTS/CTS frame */ + u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, >= 0 keyidx from +* hw->set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw->queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /* retry rate for the last retries, given as the Index: wireless-dev/net/d80211/ieee80211.c
[take3 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -240,12 +240,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (1<<0) +#define IEEE80211_CONF_SW_DECRYPT (1<<1) +#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3480,9 +3480,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf->short_slot_time != bcm->short_slot) { + if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) { assert(phy->type == BCM43xx_PHYTYPE_G); - if (conf->short_slot_time) + if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3495,7 +3495,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf->ssid_hidden) { + if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2080,7 +2081,8 @@ static int rt2400pci_config(struct net_d conf->channel_val, conf->channel, conf->freq); rt2400pci_config_txpower(rt2x00dev, conf->power_level); rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf->short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf->phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2230,7 +2231,8 @@ static int rt2500pci_config(struct net_d conf->power_level); rt2500pci_config_txpower(rt2x00dev, conf->power_level); rt2500pci_config_antenna(r
[take3 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2012,17 +2012,9 @@ static int __devinit adm8211_probe(struc hw->version = 2; hw->name = "adm8211"; - hw->host_gen_beacon = 0; - hw->device_hides_wep = 0; - hw->rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw->host_broadcast_ps_buffering = 0; - hw->wep_include_iv = 1; - hw->data_nullfunc_ack = 0; - hw->no_tkip_wmm_hwaccel = 1; - hw->extra_hdr_room = 0; - hw->device_strips_mic = 0; - hw->monitor_during_oper = 0; - hw->fraglist = 0; + hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw->channel_change_time = 1000; hw->num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -437,19 +437,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -457,18 +457,19 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) /* set if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; +#define IEEE80211_HW_EXTRA_HDR_ROOM (1<<8) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -476,15 +477,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<9) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (1<<10) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (1<<11) + + u32 flags; /* hardware flags defined above */ /* This is the time in us to change channels */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wire
[take3 2/5] d80211: remove bitfields from ieee80211_tx_status
Both one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TX_STATUS_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -209,8 +209,10 @@ struct ieee80211_tx_status { /* copied ieee80211_tx_control structure */ struct ieee80211_tx_control control; - unsigned int tx_filtered:1; - unsigned int ack:1; /* whether the TX frame was ACKed */ +#define IEEE80211_TX_STATUS_TX_FILTERED(1<<0) +#define IEEE80211_TX_STATUS_ACK(1<<1) /* whether the TX frame was ACKed */ + u32 flags; /* tx staus flags defined above */ + int ack_signal; /* measured signal strength of the ACK frame */ int excessive_retries; int retry_count; Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -426,12 +426,14 @@ static void adm8211_interrupt_tci(struct if (status & TDES0_STATUS_ES) { stats->tx_errors++; - priv->tx_buffers[entry].tx_status.ack = 0; + priv->tx_buffers[entry].tx_status.flags &= + ~IEEE80211_TX_STATUS_ACK; if (status & (TDES0_STATUS_TUF | TDES0_STATUS_TRO)) stats->tx_fifo_errors++; } else - priv->tx_buffers[entry].tx_status.ack = 1; + priv->tx_buffers[entry].tx_status.flags |= + IEEE80211_TX_STATUS_ACK; pci_unmap_single(priv->pdev, priv->tx_buffers[entry].mapping, priv->tx_buffers[entry].skb->len, PCI_DMA_TODEVICE); Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -1122,7 +1122,8 @@ void bcm43xx_dma_handle_txstatus(struct * status of the transmission. * Some fields of txstat are already filled in dma_tx(). */ - meta->txstat.ack = status->acked; + if (status->acked) + meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; meta->txstat.retry_count = status->frame_count - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, meta->skb, &(meta->txstat)); /* skb is freed by ieee80211_tx_status_irqsafe() */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -500,7 +500,8 @@ void bcm43xx_pio_handle_txstatus(struct queue->tx_devq_packets--; queue->tx_devq_used -= (packet->skb->len + phy->txhdr_size); - packet->txstat.ack = status->acked; + if (status->acked) + packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; packet->txstat.retry_count = status->frame_count - 1; ieee80211_tx_status_irqsafe(bcm->net_dev, packet->skb, &(packet->txstat)); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1741,10 +1741,11 @@ static void rt2400pci_txdone(void *data) ack = rt2x00_get_field32(txd->word0, TXD_W0_ACK); + entry->tx_status.flags = 0; /* -* TODO: How can te below field be set correctly? +* TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of +* entry->tx_status.flags be set correctly? */ - entry->tx_status.tx_filtered = 0; entry->tx_status.queue_length = ring->stats.limit; entry->tx_status.queue_number = entry->tx_status.control.queue; @@ -1756,11 +1757,10 @@ static void rt2400pci_txdone(void *data) * was succesfull. */
Re: [take3 0/5] d80211: remove bitfields from include/net/d80211.h
On Wed, Oct 25, 2006 at 03:01:29PM -0400, Jeff Garzik wrote: > On Wed, Oct 25, 2006 at 11:42:44AM -0700, David Kimdon wrote: > > Continue d80211 bitfield removal. In general, compilers have > > difficulty generating efficient code for bitfields. This patchset > > removes all bitfields from include/net/d80211.h. > > > > I converted the 1 bit bitfields into a bit in a u32/u16 or u8 flags > > structure member. Larger bitfields I converted into their > > u8/u16/whatever equivalent. > > For bit flags, usually it is best to use up to 32 bits of an > unsigned long, which guarantees that you use a machine integer for > all platforms. That is how I originally had the patch, but then had a question about increasing structure size so I dropped flags to u16 or u8 for structures that were made larger by the bitfield removal. For the key_conf bitfields size doesn't matter much. For the tx_control bitfields size matters a bit more since it is needed per-packets and dirvers currently need to store a copy to pass to the tx complete handler. Thoughts? David - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch] d80211: use pfifo_qdisc_ops rather than d80211-specific qdisc
wme.c needs a generic fifo qdisc for each hardware queue. Switch wme.c to use the generic fifo qdisc in net/sched/sch_fifo.c. This allows removal of net/d80211/fifo_qdisc.c which isn't particularily tied to IEEE 802.11 in any way. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/Makefile === --- wireless-dev.orig/net/d80211/Makefile +++ wireless-dev/net/d80211/Makefile @@ -21,6 +21,3 @@ obj-$(CONFIG_D80211) += 80211.o rc80211_ wme.o \ $(80211-objs-y) -ifeq ($(CONFIG_NET_SCHED),) - 80211-objs += fifo_qdisc.o -endif Index: wireless-dev/net/d80211/wme.c === --- wireless-dev.orig/net/d80211/wme.c +++ wireless-dev/net/d80211/wme.c @@ -18,8 +18,6 @@ #include "ieee80211_i.h" #include "wme.h" -#define CHILD_QDISC_OPS pfifo_qdisc_ops - static inline int WLAN_FC_IS_QOS_DATA(u16 fc) { return (fc & 0x8C) == 0x88; @@ -433,7 +431,7 @@ static int wme_qdiscop_init(struct Qdisc /* create child queues */ for (i = 0; i < queues; i++) { skb_queue_head_init(&q->requeued[i]); - q->queues[i] = qdisc_create_dflt(qd->dev, &CHILD_QDISC_OPS); + q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops); if (q->queues[i] == 0) { q->queues[i] = &noop_qdisc; printk(KERN_ERR "%s child qdisc %i creation failed", dev->name, i); Index: wireless-dev/net/d80211/fifo_qdisc.c === --- wireless-dev.orig/net/d80211/fifo_qdisc.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2005, Devicescape Software, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * If building without CONFIG_NET_SCHED we need a simple - * fifo qdisc to install by default as the sub-qdisc. - * This is a simple replacement for sch_fifo. - */ - -#include -#include -#include -#include "ieee80211_i.h" -#include "wme.h" - -static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc* qd) -{ - struct sk_buff_head *q = qdisc_priv(qd); - - if (skb_queue_len(q) > qd->dev->tx_queue_len) { - qd->qstats.drops++; - kfree_skb(skb); - return NET_XMIT_DROP; - } - - skb_queue_tail(q, skb); - qd->q.qlen++; - qd->bstats.bytes += skb->len; - qd->bstats.packets++; - - return NET_XMIT_SUCCESS; -} - - -static int pfifo_requeue(struct sk_buff *skb, struct Qdisc* qd) -{ - struct sk_buff_head *q = qdisc_priv(qd); - - skb_queue_head(q, skb); - qd->q.qlen++; - qd->bstats.bytes += skb->len; - qd->bstats.packets++; - - return NET_XMIT_SUCCESS; -} - - -static struct sk_buff *pfifo_dequeue(struct Qdisc* qd) -{ - struct sk_buff_head *q = qdisc_priv(qd); - - return skb_dequeue(q); -} - - -static int pfifo_init(struct Qdisc* qd, struct rtattr *opt) -{ - struct sk_buff_head *q = qdisc_priv(qd); - - skb_queue_head_init(q); - return 0; -} - - -static void pfifo_reset(struct Qdisc* qd) -{ - struct sk_buff_head *q = qdisc_priv(qd); - - skb_queue_purge(q); - qd->q.qlen = 0; -} - - -static int pfifo_dump(struct Qdisc *qd, struct sk_buff *skb) -{ - return skb->len; -} - - -struct Qdisc_ops pfifo_qdisc_ops = -{ - .next = NULL, - .cl_ops = NULL, - .id = "ieee80211_pfifo", - .priv_size = sizeof(struct sk_buff_head), - - .enqueue = pfifo_enqueue, - .dequeue = pfifo_dequeue, - .requeue = pfifo_requeue, - .drop = NULL, - - .init = pfifo_init, - .reset = pfifo_reset, - .destroy = NULL, - .change = NULL, - - .dump = pfifo_dump, -}; - Index: wireless-dev/net/d80211/Kconfig === --- wireless-dev.orig/net/d80211/Kconfig +++ wireless-dev/net/d80211/Kconfig @@ -3,6 +3,7 @@ config D80211 select CRYPTO select CRYPTO_ARC4 select CRYPTO_AES + select NET_SCHED ---help--- This option enables the hardware independent IEEE 802.11 networking stack. -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC] d80211: switch crypto to use block ciphers
The purpose of this patch is to fix the compile-time warnings usch as: warning: 'crypto_cipher_encrypt' is deprecated (declared at include/linux/crypto.h:842) I have tested static WEP and it still works after this change. AECS/CCM and TKIP I am assuming work as well. I don't actually know the implications of that first hunk where we do "arc4" -> "ecb(arc4)". I look though the various commits by Herbert Xu and that appeared to be the right thing. Hopefully someone who understands this better than I can review the change. Thanks, David -- Switch d80211 software crypto to use the block cipher API. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/wep.c === --- wireless-dev.orig/net/d80211/wep.c +++ wireless-dev/net/d80211/wep.c @@ -26,7 +26,8 @@ int ieee80211_wep_init(struct ieee80211_ /* start WEP IV from a random value */ get_random_bytes(&local->wep_iv, WEP_IV_LEN); - local->wep_tfm = crypto_alloc_tfm("arc4", 0); + local->wep_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, + CRYPTO_ALG_ASYNC); if (!local->wep_tfm) return -ENOMEM; @@ -35,7 +36,7 @@ int ieee80211_wep_init(struct ieee80211_ void ieee80211_wep_free(struct ieee80211_local *local) { - crypto_free_tfm(local->wep_tfm); + crypto_free_blkcipher(local->wep_tfm); } static inline int ieee80211_wep_weak_iv(u32 iv, int keylen) @@ -116,20 +117,21 @@ void ieee80211_wep_remove_iv(struct ieee /* Perform WEP encryption using given key. data buffer must have tailroom * for 4-byte ICV. data_len must not include this ICV. Note: this function * does _not_ add IV. data = RC4(data | CRC32(data)) */ -void ieee80211_wep_encrypt_data(struct crypto_tfm *tfm, u8 *rc4key, +void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { + struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 *icv; icv = (__le32 *)(data + data_len); *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); - crypto_cipher_setkey(tfm, rc4key, klen); + crypto_blkcipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_cipher_encrypt(tfm, &sg, &sg, sg.length); + crypto_blkcipher_encrypt(&desc, &sg, &sg, sg.length); } @@ -183,17 +185,18 @@ int ieee80211_wep_encrypt(struct ieee802 /* Perform WEP decryption using given key. data buffer includes encrypted * payload, including 4-byte ICV, but _not_ IV. data_len must not include ICV. * Return 0 on success and -1 on ICV mismatch. */ -int ieee80211_wep_decrypt_data(struct crypto_tfm *tfm, u8 *rc4key, +int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { + struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 crc; - crypto_cipher_setkey(tfm, rc4key, klen); + crypto_blkcipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_cipher_decrypt(tfm, &sg, &sg, sg.length); + crypto_blkcipher_decrypt(&desc, &sg, &sg, sg.length); crc = cpu_to_le32(~crc32_le(~0, data, data_len)); if (memcmp(&crc, data + data_len, WEP_ICV_LEN) != 0) Index: wireless-dev/net/d80211/aes_ccm.c === --- wireless-dev.orig/net/d80211/aes_ccm.c +++ wireless-dev/net/d80211/aes_ccm.c @@ -16,9 +16,10 @@ #include "aes_ccm.h" -static void ieee80211_aes_encrypt(struct crypto_tfm *tfm, +static void ieee80211_aes_encrypt(struct crypto_blkcipher *tfm, const u8 pt[16], u8 ct[16]) { + struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist src, dst; src.page = virt_to_page(pt); @@ -29,11 +30,11 @@ static void ieee80211_aes_encrypt(struct dst.offset = offset_in_page(ct); dst.length = AES_BLOCK_LEN; - crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); + crypto_blkcipher_encrypt(&desc, &dst, &src, AES_BLOCK_LEN); } -static inline void aes_ccm_prepare(struct crypto_tfm *tfm, u8 *b_0, u8 *aad, +static inline void aes_ccm_prepare(struct crypto_blkcipher *tfm, u8 *b_0, u8 *aad, u8 *b, u8 *s_0, u8 *a) { int i; @@ -61,7 +62,7 @@ static inline void aes_ccm_prepare(struc } -void ieee80211_aes_ccm_encrypt(struct crypto_tfm *tfm, u8
[take1] d80211: switch crypto to use new ciphers API
On Thu, Oct 26, 2006 at 10:06:24AM +1000, Herbert Xu wrote: > If you're only encrypting/decrypting a single block then you should > use the cipher interface. So net/d80211/aes_ccm.c should do that > instead. See drivers/net/wirless/airo.c for an example of that. Thanks Herbert. Updated patch, now aes, tkip and wep are all tested. Changes from take0: Use IS_ERR() to evaluate return value of crypto_alloc_cipher(). Use ciper interface rather than blkcipher for aes encryption since we only encrypt a single block at a time. Switch d80211 software crypto to use the new cipher API. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/d80211/wep.c === --- wireless-dev.orig/net/d80211/wep.c +++ wireless-dev/net/d80211/wep.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -26,8 +27,9 @@ int ieee80211_wep_init(struct ieee80211_ /* start WEP IV from a random value */ get_random_bytes(&local->wep_iv, WEP_IV_LEN); - local->wep_tfm = crypto_alloc_tfm("arc4", 0); - if (!local->wep_tfm) + local->wep_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, + CRYPTO_ALG_ASYNC); + if (IS_ERR(local->wep_tfm)) return -ENOMEM; return 0; @@ -35,7 +37,7 @@ int ieee80211_wep_init(struct ieee80211_ void ieee80211_wep_free(struct ieee80211_local *local) { - crypto_free_tfm(local->wep_tfm); + crypto_free_blkcipher(local->wep_tfm); } static inline int ieee80211_wep_weak_iv(u32 iv, int keylen) @@ -116,20 +118,21 @@ void ieee80211_wep_remove_iv(struct ieee /* Perform WEP encryption using given key. data buffer must have tailroom * for 4-byte ICV. data_len must not include this ICV. Note: this function * does _not_ add IV. data = RC4(data | CRC32(data)) */ -void ieee80211_wep_encrypt_data(struct crypto_tfm *tfm, u8 *rc4key, +void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { + struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 *icv; icv = (__le32 *)(data + data_len); *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); - crypto_cipher_setkey(tfm, rc4key, klen); + crypto_blkcipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_cipher_encrypt(tfm, &sg, &sg, sg.length); + crypto_blkcipher_encrypt(&desc, &sg, &sg, sg.length); } @@ -183,17 +186,18 @@ int ieee80211_wep_encrypt(struct ieee802 /* Perform WEP decryption using given key. data buffer includes encrypted * payload, including 4-byte ICV, but _not_ IV. data_len must not include ICV. * Return 0 on success and -1 on ICV mismatch. */ -int ieee80211_wep_decrypt_data(struct crypto_tfm *tfm, u8 *rc4key, +int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { + struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 crc; - crypto_cipher_setkey(tfm, rc4key, klen); + crypto_blkcipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_cipher_decrypt(tfm, &sg, &sg, sg.length); + crypto_blkcipher_decrypt(&desc, &sg, &sg, sg.length); crc = cpu_to_le32(~crc32_le(~0, data, data_len)); if (memcmp(&crc, data + data_len, WEP_ICV_LEN) != 0) Index: wireless-dev/net/d80211/aes_ccm.c === --- wireless-dev.orig/net/d80211/aes_ccm.c +++ wireless-dev/net/d80211/aes_ccm.c @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -16,24 +17,14 @@ #include "aes_ccm.h" -static void ieee80211_aes_encrypt(struct crypto_tfm *tfm, +static void ieee80211_aes_encrypt(struct crypto_cipher *tfm, const u8 pt[16], u8 ct[16]) { - struct scatterlist src, dst; - - src.page = virt_to_page(pt); - src.offset = offset_in_page(pt); - src.length = AES_BLOCK_LEN; - - dst.page = virt_to_page(ct); - dst.offset = offset_in_page(ct); - dst.length = AES_BLOCK_LEN; - - crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); + crypto_cipher_encrypt_one(tfm, ct, pt); } -static inline void aes_ccm_prepare(struct crypto_tfm *tfm, u8 *b_0, u8 *aad, +static inline void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *b, u8 *s_0, u8 *a) {
[patch] make sch_fifo.o available when CONFIG_NET_SCHED is not set
You may see this discussion for more info: http://marc.theaimsgroup.com/?t=11618139512&r=1&w=2 Based on a patch by Patrick McHardy. Add a new option, NET_SCH_FIFO, which provides a simple fifo qdisc without requiring CONFIG_NET_SCHED. The d80211 stack needs a generic fifo qdisc for WME. At present it uses net/d80211/fifo_qdisc.c which is functionally equivalent to sch_fifo.c. This patch will allow the d80211 stack to remove net/d80211/fifo_qdisc.c and use sch_fifo.c instead. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/sched/Kconfig === --- wireless-dev.orig/net/sched/Kconfig +++ wireless-dev/net/sched/Kconfig @@ -6,6 +6,7 @@ menu "QoS and/or fair queueing" config NET_SCHED bool "QoS and/or fair queueing" + select NET_SCH_FIFO ---help--- When the kernel has several packets to send out over a network device, it has to decide which ones to send first, which ones to @@ -40,6 +41,15 @@ config NET_SCHED The available schedulers are listed in the following questions; you can say Y to as many as you like. If unsure, say N now. +config NET_SCH_FIFO + tristate "Simple Fifo Qdisc (PFIFO, BFIFO)" + ---help--- + Say Y here if you want to use the simple pfifo or bfifo + packet scheduling algorithms. + + To compile this code as a module, choose M here: the + module will be called sch_fifo. + if NET_SCHED choice Index: wireless-dev/net/sched/Makefile === --- wireless-dev.orig/net/sched/Makefile +++ wireless-dev/net/sched/Makefile @@ -4,7 +4,7 @@ obj-y := sch_generic.o -obj-$(CONFIG_NET_SCHED)+= sch_api.o sch_fifo.o sch_blackhole.o +obj-$(CONFIG_NET_SCHED)+= sch_api.o sch_blackhole.o obj-$(CONFIG_NET_CLS) += cls_api.o obj-$(CONFIG_NET_CLS_ACT) += act_api.o obj-$(CONFIG_NET_ACT_POLICE) += act_police.o @@ -14,6 +14,7 @@ obj-$(CONFIG_NET_ACT_MIRRED) += act_mirr obj-$(CONFIG_NET_ACT_IPT) += act_ipt.o obj-$(CONFIG_NET_ACT_PEDIT)+= act_pedit.o obj-$(CONFIG_NET_ACT_SIMP) += act_simple.o +obj-$(CONFIG_NET_SCH_FIFO) += sch_fifo.o obj-$(CONFIG_NET_SCH_CBQ) += sch_cbq.o obj-$(CONFIG_NET_SCH_HTB) += sch_htb.o obj-$(CONFIG_NET_SCH_HPFQ) += sch_hpfq.o -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch] make sch_fifo.o available when CONFIG_NET_SCHED is not set
On Wed, Nov 01, 2006 at 12:24:01AM +0100, Thomas Graf wrote: > I think NET_SCH_FIFO doesn't need a help text, should be invisible > to the user. Just select it from NET_SCHED and d80211. sure, here is a new one: Based on patch by Patrick McHardy. Add a new option, NET_SCH_FIFO, which provides a simple fifo qdisc without requiring CONFIG_NET_SCHED. The d80211 stack needs a generic fifo qdisc for WME. At present it uses net/d80211/fifo_qdisc.c which is functionally equivalent to sch_fifo.c. This patch will allow the d80211 stack to remove net/d80211/fifo_qdisc.c and use sch_fifo.c instead. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/net/sched/Kconfig === --- wireless-dev.orig/net/sched/Kconfig +++ wireless-dev/net/sched/Kconfig @@ -6,6 +6,7 @@ menu "QoS and/or fair queueing" config NET_SCHED bool "QoS and/or fair queueing" + select NET_SCH_FIFO ---help--- When the kernel has several packets to send out over a network device, it has to decide which ones to send first, which ones to @@ -40,6 +41,9 @@ config NET_SCHED The available schedulers are listed in the following questions; you can say Y to as many as you like. If unsure, say N now. +config NET_SCH_FIFO + bool + if NET_SCHED choice Index: wireless-dev/net/sched/Makefile === --- wireless-dev.orig/net/sched/Makefile +++ wireless-dev/net/sched/Makefile @@ -4,7 +4,7 @@ obj-y := sch_generic.o -obj-$(CONFIG_NET_SCHED)+= sch_api.o sch_fifo.o sch_blackhole.o +obj-$(CONFIG_NET_SCHED)+= sch_api.o sch_blackhole.o obj-$(CONFIG_NET_CLS) += cls_api.o obj-$(CONFIG_NET_CLS_ACT) += act_api.o obj-$(CONFIG_NET_ACT_POLICE) += act_police.o @@ -14,6 +14,7 @@ obj-$(CONFIG_NET_ACT_MIRRED) += act_mirr obj-$(CONFIG_NET_ACT_IPT) += act_ipt.o obj-$(CONFIG_NET_ACT_PEDIT)+= act_pedit.o obj-$(CONFIG_NET_ACT_SIMP) += act_simple.o +obj-$(CONFIG_NET_SCH_FIFO) += sch_fifo.o obj-$(CONFIG_NET_SCH_CBQ) += sch_cbq.o obj-$(CONFIG_NET_SCH_HTB) += sch_htb.o obj-$(CONFIG_NET_SCH_HPFQ) += sch_hpfq.o - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [take3 0/5] d80211: remove bitfields from include/net/d80211.h
On Thu, Nov 02, 2006 at 10:30:56PM -0500, John W. Linville wrote: > David, may I presume there will be a "take4"? yes, refreshing is in progress. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take4 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -141,36 +141,38 @@ struct ieee80211_tx_control { int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw * specific value for the rate (from * struct ieee80211_rate) */ - /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; - /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, >= 0 keyidx from hw->set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw->queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + +#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(1<<2) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(1<<3) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(1<<5) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) +#define IEEE80211_TXCTL_REQUEUE(1<<7) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of + * the frame */ + u32 flags; /* tx control flags defined + * above */ + u16 rts_cts_duration; /* duration field for RTS/CTS frame */ + u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, >= 0 keyidx from +* hw->set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw->queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /* retry rate for the last retries, given as the Index: wireless-dev/net/d80211/ieee80211.c
[take4 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2025,17 +2025,10 @@ static int __devinit adm8211_probe(struc hw->version = 2; hw->name = "adm8211"; - hw->host_gen_beacon = 0; - hw->device_hides_wep = 0; - hw->rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw->host_broadcast_ps_buffering = 0; - hw->wep_include_iv = 1; - hw->data_nullfunc_ack = 0; - hw->no_tkip_wmm_hwaccel = 1; hw->extra_tx_headroom = 0; - hw->device_strips_mic = 0; - hw->monitor_during_oper = 0; - hw->fraglist = 0; + hw->flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw->channel_change_time = 1000; hw->num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -439,19 +439,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (1<<2) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -459,14 +459,15 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (1<<5) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (1<<6) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (1<<7) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -474,15 +475,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (1<<8) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (1<<9) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (1<<10) + + u32 flags; /* hardware flags defined above */ /* Set to the size of a needed device specific skb headroom for TX skbs. */ unsigned int extra_tx_headroom; Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3971,9 +3971,10 @@ static int __devinit bcm43xx_init_one(st goto o
[take4 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon <[EMAIL PROTECTED]> Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -242,12 +242,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (1<<0) +#define IEEE80211_CONF_SW_DECRYPT (1<<1) +#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<2) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (1<<3) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3562,9 +3562,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf->channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf->short_slot_time != bcm->short_slot) { + if (!!(conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) != bcm->short_slot) { assert(phy->type == BCM43xx_PHYTYPE_G); - if (conf->short_slot_time) + if (conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3577,7 +3577,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf->ssid_hidden) { + if (conf->flags & IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm->wlcore, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2088,7 +2089,8 @@ static int rt2400pci_config(struct net_d conf->channel_val, conf->channel, conf->freq); rt2400pci_config_txpower(rt2x00dev, conf->power_level); rt2400pci_config_antenna(rt2x00dev, conf->antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf->short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf->phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, ®[0]); value = SIFS + PLCP - + (2 * (conf->short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(®[0], TXCSR1_ACK_TIMEOUT, value); @@ -2238,7 +2239,8 @@ static int rt2500pci_config(struct net_d conf->power_level); rt2500pci_config_txpower(rt2x00dev, conf->power_level); rt2500pci_config_antenna(r