Skip to contentSkip to conversation

cfg80211 API for channels/bitrates, mac80211 and driver conversion

DISCUSSION Johannes Berg 3 participants 5 messages Dec 28, 2007

lore
Share & tools
lore
#0 lore raw

This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out.

Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling.

Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff.

---
 drivers/net/wireless/adm8211.c               |   80 ++--
 drivers/net/wireless/adm8211.h               |   65 ---
 drivers/net/wireless/b43/b43.h               |    5 
 drivers/net/wireless/b43/main.c              |  162 ++++-----
 drivers/net/wireless/b43/sysfs.c             |   89 -----
 drivers/net/wireless/b43/xmit.c              |   73 ++--
 drivers/net/wireless/b43legacy/b43legacy.h   |    4 
 drivers/net/wireless/b43legacy/main.c        |  159 ++++-----
 drivers/net/wireless/b43legacy/xmit.c        |   64 +-- 
 drivers/net/wireless/iwlwifi/iwl-3945-rs.c   |   79 ++--
 drivers/net/wireless/iwlwifi/iwl-3945.c      |   35 --
 drivers/net/wireless/iwlwifi/iwl-3945.h      |   13 
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c   |   82 ++--
 drivers/net/wireless/iwlwifi/iwl-4965.c      |   35 --
 drivers/net/wireless/iwlwifi/iwl-4965.h      |   13 
 drivers/net/wireless/iwlwifi/iwl3945-base.c  |  445 +++++++--------------------
 drivers/net/wireless/iwlwifi/iwl4965-base.c  |  438 ++++++--------------------
 drivers/net/wireless/p54.h                   |    4 
 drivers/net/wireless/p54common.c             |   74 ++--
 drivers/net/wireless/p54common.h             |   75 ----
 drivers/net/wireless/rt2x00/rt2400pci.c      |    2   
 drivers/net/wireless/rt2x00/rt2500pci.c      |    4   
 drivers/net/wireless/rt2x00/rt2500usb.c      |    4   
 drivers/net/wireless/rt2x00/rt2x00.h         |   11   
 drivers/net/wireless/rt2x00/rt2x00config.c   |   37 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c      |  151 +++------
 drivers/net/wireless/rt2x00/rt61pci.c        |   27 -
 drivers/net/wireless/rt2x00/rt73usb.c        |   27 -
 drivers/net/wireless/rtl8180.h               |    2  
 drivers/net/wireless/rtl8180_dev.c           |   93 +++--
 drivers/net/wireless/rtl8180_grf5101.c       |    3 
 drivers/net/wireless/rtl8180_max2820.c       |    5 
 drivers/net/wireless/rtl8180_rtl8225.c       |   15 
 drivers/net/wireless/rtl8180_sa2400.c        |    5 
 drivers/net/wireless/rtl8187.h               |    2 
 drivers/net/wireless/rtl8187_dev.c           |   84 +++--
 drivers/net/wireless/rtl8187_rtl8225.c       |    8 
 drivers/net/wireless/rtl818x.h               |   70 ----
 drivers/net/wireless/zd1211rw/zd_chip.c      |   15 
 drivers/net/wireless/zd1211rw/zd_ieee80211.c |   11 
 drivers/net/wireless/zd1211rw/zd_mac.c       |  168 ++++------
 drivers/net/wireless/zd1211rw/zd_mac.h       |    2 
 include/net/mac80211.h                       |  197 ++---------
 include/net/wireless.h                       |  168 ++++++++++ 
 net/mac80211/Makefile                        |    1 
 net/mac80211/cfg.c                           |   11 
 net/mac80211/debugfs.c                       |   47 --
 net/mac80211/debugfs_sta.c                   |   18 - 
 net/mac80211/ieee80211.c                     |  112 ++----
 net/mac80211/ieee80211_i.h                   |   65 ---   
 net/mac80211/ieee80211_iface.c               |    2       
 net/mac80211/ieee80211_ioctl.c               |  131 ++++---
 net/mac80211/ieee80211_rate.c                |   20 -
 net/mac80211/ieee80211_rate.h                |   28 -
 net/mac80211/ieee80211_sta.c                 |  380 ++++++++++++-----------
 net/mac80211/rc80211_pid_algo.c              |   70 ++--
 net/mac80211/rc80211_simple.c                |   62 +-- 
 net/mac80211/regdomain.c                     |  152 ---------
 net/mac80211/rx.c                            |   56 +--
 net/mac80211/sta_info.c                      |   24 -  
 net/mac80211/sta_info.h                      |   10    
 net/mac80211/tx.c                            |  162 ++++++---
 net/mac80211/util.c                          |  142 +------- 
 net/wireless/Makefile                        |    2 
 net/wireless/core.c                          |   41 ++
 net/wireless/core.h                          |    3   
 net/wireless/reg.c                           |  153 +++++++++
 net/wireless/util.c                          |   98 +++++
 68 files changed, 2102 insertions(+), 2793 deletions(-)  

patch too large, please see

http://johannes.sipsolutions.net/patches/kernel/all/2007-12-28-21%3a44/023-cfg80211-channel-and-bitrate-api.patch

#1 lore raw

From: Johannes Berg <[email protected]>
Date: Fri, 28 Dec 2007 22:50:33 +0100

Quoted 1 line
 include/net/wireless.h                       |  168 ++++++++++ 

Are the datastructures in this file the ones that go over netlink and thus userland sees?

If so, please move the definitions to some file under include/linux, as a convention we do not put userland API definitions into files under include/net, that's why there is no include/net/Kbuild file.

#2 lore raw
Quoted 5 lines
Quoted 2 lines
 include/net/wireless.h                       |  168 ++++++++++ 

Are the datastructures in this file the ones that go over netlink and thus userland sees?

No. These are purely the internal definitions, I'm just working on defining the netlink attributes for the information going over to userland (in include/linux/nl80211.h).

johannes

#3 lore raw

From: Johannes Berg <[email protected]>
Date: Fri, 28 Dec 2007 23:05:14 +0100

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
 include/net/wireless.h                       |  168 ++++++++++ 

Are the datastructures in this file the ones that go over netlink and thus userland sees?

No. These are purely the internal definitions, I'm just working on defining the netlink attributes for the information going over to userland (in include/linux/nl80211.h).

Excellent, thanks for the explanation.

#4 lore raw
In reply to Johannes Berg
Quoted 16 lines · On Friday 28 December 2007 22:50:33 Johannes Berg wrote:

This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out.

Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling.

Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff.

Quoted 10 lines
---
 drivers/net/wireless/adm8211.c               |   80 ++--
 drivers/net/wireless/adm8211.h               |   65 ---
 drivers/net/wireless/b43/b43.h               |    5 
 drivers/net/wireless/b43/main.c              |  162 ++++-----
 drivers/net/wireless/b43/sysfs.c             |   89 -----
 drivers/net/wireless/b43/xmit.c              |   73 ++--
 drivers/net/wireless/b43legacy/b43legacy.h   |    4 
 drivers/net/wireless/b43legacy/main.c        |  159 ++++-----
 drivers/net/wireless/b43legacy/xmit.c        |   64 +-- 

Ack for the b43 and b43legacy changes.
But that one FIXME for the bphy should get fixed first in b43legacy. You can drop the FIXME in b43, as b43 does not support bphy devices.

I'll probably submit a few changes to this after this was applied.

Signature · 1 line
Greetings Michael.