aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2012-11-29mac80211: add debugfs file for current tx rateSaravana1-0/+16
Add a debugfs file showing the current tx rate. The information available in the rc_stats file doesn't evidently provides us the current tx rate. This patch adds the support for the same. Signed-off-by: Saravana <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-29mac80211: add debugfs file for last ack signalSaravana3-0/+7
Add a debugfs file showing the signal strength of the ack frame that is received for the currently sent tx packet Signed-off-by: Saravana <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-29cfg80211: Remove unused VHT chan codeMahesh Palivela1-27/+1
Cleanup of unused VHT channel config related code. Signed-off-by: Mahesh Palivela <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-28Merge branch 'fixes' of ↵David S. Miller2-10/+6
git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch Two small openswitch fixes from Jesse Gross. Signed-off-by: David S. Miller <[email protected]>
2012-11-28Merge branch 'for-davem' of ↵David S. Miller66-1521/+3960
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next John W. Linville says: ==================== This pull request is intended for the 3.8 stream. It is a bit large -- I guess Thanksgiving got me off track! At least the code got to spend some time in linux-next... :-) This includes the usual batch of pulls for Bluetooth, NFC, and mac80211 as well as iwlwifi. Also here is an ath6kl pull, and a new driver in the rtlwifi family. The brcmfmac, brcmsmac, ath9k, and mwl8k get their usual levels of attention, and a handful of other updates tag along as well. For more detail on the pulls, please see below... On Bluetooth, Gustavo says: "Another set of patches for integration in wireless-next. There are two big set of changes in it: Andrei Emeltchenko and Mat Martineau added more patches towards a full Bluetooth High Speed support and Johan Hedberg improve the single mode support for Bluetooth dongles. Apart from that we have small fixes and improvements." ...and: "A few patches to 3.8. The majority of the work here is from Andrei on the High Speed support. Other than that Johan added support for setting LE advertising data. The rest are fixes and clean ups and small improvements like support for a new broadcom hardware." On mac80211, Johannes says: "This is for mac80211, for -next (3.8). Plenty of changes, as you can see below. Some fixes for previous changes like the export.h include, the beacon listener fix from Ben Greear, etc. Overall, no exciting new features, though hwsim does gain channel context support for people to try it out and look at." ...and...: "This one contains the mac80211-next material. Apart from a few small new features and cleanups I have two fixes for the channel context code. The RX_END timestamp support will probably be reworked again as Simon Barber noted the calculations weren't really valid, but the discussions there are still going on and it's better than what we had before." ...and: "Please pull (see below) to get the following changes: * a fix & a debug aid in IBSS from Antonio, * mesh cleanups from Marco, * a few bugfixes for some of my previous patches from Arend and myself, * and the big initial VHT support patchset" And on iwlwifi, Johannes says: "In addition to the previous four patches that I'm not resending, we have a number of cleanups, message reduction, firmware error handling improvements (yes yes... we need to fix them instead) and various other small things all over." ...and: "In his quest to try to understand the current iwlwifi problems (like stuck queues etc.) Emmanuel has first cleaned up the PCIe code, I'm including his changes in this pull request. Other than that I only have a small cleanup from Sachin Kamat to remove a duplicate include and a bugfix to turn off MFP if software crypto is enabled, but this isn't really interesting as MFP isn't supported right now anyway." On NFC, Samuel says: "With this one we have: - A few HCI improvements in preparation for an upcoming HCI chipset support. - A pn544 code cleanup after the old driver was removed. - An LLCP improvement for notifying user space when one peer stops ACKing I frames." On ath6kl, Kalle says: "Major changes this time are firmware recover support to gracefully handle if firmware crashes, support for changing regulatory domain and support for new ar6004 hardware revision 1.4. Otherwise there are just smaller fixes or cleanups from different people." Thats about it... :-) Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <[email protected]>
2012-11-28openvswitch: Use RCU callback when detaching netdevices.Jesse Gross2-4/+13
Currently, each time a device is detached from an OVS datapath we call synchronize RCU before freeing associated data structures. However, if a bridge is deleted (which detaches all ports) when many devices are connected then there can be a long delay. This switches to use call_rcu() to group the cost together. Reported-by: Justin Pettit <[email protected]> Signed-off-by: Jesse Gross <[email protected]>
2012-11-28NFC: Fix incorrect llcp pointer dereferenceWaldemar Rymarkiewicz1-1/+4
nfc_llcp_ns(s) dereferences the s pointer which is freed a line above. In a result, it can produce a crash or you will read incorrect value. Signed-off-by: Waldemar Rymarkiewicz <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2012-11-28ip6tnl/sit: drop packet if ECN present with not-ECTNicolas Dichtel2-29/+53
This patch reports the change made by Stephen Hemminger in ipip and gre[6] in commit eccc1bb8d4b4 (tunnel: drop packet if ECN present with not-ECT). Goal is to handle RFC6040, Section 4.2: Default Tunnel Egress Behaviour. o If the inner ECN field is Not-ECT, the decapsulator MUST NOT propagate any other ECN codepoint onwards. This is because the inner Not-ECT marking is set by transports that rely on dropped packets as an indication of congestion and would not understand or respond to any other ECN codepoint [RFC4774]. Specifically: * If the inner ECN field is Not-ECT and the outer ECN field is CE, the decapsulator MUST drop the packet. * If the inner ECN field is Not-ECT and the outer ECN field is Not-ECT, ECT(0), or ECT(1), the decapsulator MUST forward the outgoing packet with the ECN field cleared to Not-ECT. The patch takes benefits from common function added in net/inet_ecn.h. Like it was done for Xin4 tunnels, it adds logging to allow detecting broken systems that set ECN bits incorrectly when tunneling (or an intermediate router might be changing the header). Errors are also tracked via rx_frame_error. CC: Stephen Hemminger <[email protected]> Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28Merge branch 'master' of git://1984.lsi.us.es/nfDavid S. Miller1-1/+1
An interface name overflow fix in netfilter via Pablo Neira Ayuso. Signed-off-by: David S. Miller <[email protected]>
2012-11-28irda: irttp: fix memory leak in irttp_open_tsap() error pathTommi Rantala1-0/+1
Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit this error path. The leak goes back to at least 1da177e4 ("Linux-2.6.12-rc2"). Discovered with Trinity (the syscall fuzzer). Signed-off-by: Tommi Rantala <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28pkt_sched: QFQ Plus: fair-queueing service at DRR costPaolo Valente1-264/+566
This patch turns QFQ into QFQ+, a variant of QFQ that provides the following two benefits: 1) QFQ+ is faster than QFQ, 2) differently from QFQ, QFQ+ correctly schedules also non-leaves classes in a hierarchical setting. A detailed description of QFQ+, plus a performance comparison with DRR and QFQ, can be found in [1]. [1] P. Valente, "Reducing the Execution Time of Fair-Queueing Schedulers" http://algo.ing.unimo.it/people/paolo/agg-sched/agg-sched.pdf Signed-off-by: Paolo Valente <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28sctp: Error in calculation of RTTvarSchoch Christian1-1/+1
The calculation of RTTVAR involves the subtraction of two unsigned numbers which may causes rollover and results in very high values of RTTVAR when RTT > SRTT. With this patch it is possible to set RTOmin = 1 to get the minimum of RTO at 4 times the clock granularity. Change Notes: v2) *Replaced abs() by abs64() and long by __s64, changed patch description. Signed-off-by: Christian Schoch <[email protected]> CC: Vlad Yasevich <[email protected]> CC: Sridhar Samudrala <[email protected]> CC: Neil Horman <[email protected]> CC: [email protected] Acked-by: Vlad Yasevich <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28sctp: fix -ENOMEM result with invalid user space pointer in sendto() syscallTommi Rantala2-6/+11
Consider the following program, that sets the second argument to the sendto() syscall incorrectly: #include <string.h> #include <arpa/inet.h> #include <sys/socket.h> int main(void) { int fd; struct sockaddr_in sa; fd = socket(AF_INET, SOCK_STREAM, 132 /*IPPROTO_SCTP*/); if (fd < 0) return 1; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_addr.s_addr = inet_addr("127.0.0.1"); sa.sin_port = htons(11111); sendto(fd, NULL, 1, 0, (struct sockaddr *)&sa, sizeof(sa)); return 0; } We get -ENOMEM: $ strace -e sendto ./demo sendto(3, NULL, 1, 0, {sa_family=AF_INET, sin_port=htons(11111), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ENOMEM (Cannot allocate memory) Propagate the error code from sctp_user_addto_chunk(), so that we will tell user space what actually went wrong: $ strace -e sendto ./demo sendto(3, NULL, 1, 0, {sa_family=AF_INET, sin_port=htons(11111), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EFAULT (Bad address) Noticed while running Trinity (the syscall fuzzer). Signed-off-by: Tommi Rantala <[email protected]> Acked-by: Vlad Yasevich <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28sctp: fix memory leak in sctp_datamsg_from_user() when copy from user space ↵Tommi Rantala1-2/+5
fails Trinity (the syscall fuzzer) discovered a memory leak in SCTP, reproducible e.g. with the sendto() syscall by passing invalid user space pointer in the second argument: #include <string.h> #include <arpa/inet.h> #include <sys/socket.h> int main(void) { int fd; struct sockaddr_in sa; fd = socket(AF_INET, SOCK_STREAM, 132 /*IPPROTO_SCTP*/); if (fd < 0) return 1; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_addr.s_addr = inet_addr("127.0.0.1"); sa.sin_port = htons(11111); sendto(fd, NULL, 1, 0, (struct sockaddr *)&sa, sizeof(sa)); return 0; } As far as I can tell, the leak has been around since ~2003. Signed-off-by: Tommi Rantala <[email protected]> Acked-by: Vlad Yasevich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-28Merge branch 'master' of ↵John W. Linville66-1521/+3960
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/pcie/tx.c
2012-11-28mac80211: don't reinit rate control when mesh sta existsHelmut Schaa1-1/+2
This fixes some unintended resets of the rate control statistics when minstrel_ht is used resulting in non-optimal throughput on mesh links. Tested-by: Emanuel Taube <[email protected]> Signed-off-by: Helmut Schaa <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-28mac80211: reject setting masked mac addressesHelmut Schaa1-0/+45
If a driver registers an address mask we should ensure that no interface gets an address assigned that isn't covered by the registered address mask. This prevents invalid configurations from reaching the device and causing problems. Signed-off-by: Helmut Schaa <[email protected]> [change function flow to reduce indentation, fix locking] Signed-off-by: Johannes Berg <[email protected]>
2012-11-28mac80211: fix potential NULL dereferenceDan Carpenter1-1/+1
Smatch complains that we could dereference skb later in the function. It's probably unlikely, but we may as well return here and avoid it. Signed-off-by: Dan Carpenter <[email protected]> [change summary] Signed-off-by: Johannes Berg <[email protected]>
2012-11-28nl80211: remove unnecessary checksJohannes Berg1-3/+2
The CQM TX-error rate/interval can't be less than zero since they're unsigned values, remove checks. Also fix indentation of the function. Signed-off-by: Johannes Berg <[email protected]>
2012-11-28pppoatm: take ATM socket lock in pppoatm_send()Krzysztof Mazur1-2/+17
The pppoatm_send() does not take any lock that will prevent concurrent vcc_sendmsg(). This causes two problems: - there is no locking between checking the send queue size with atm_may_send() and incrementing sk_wmem_alloc, and the real queue size can be a little higher than sk_sndbuf - the vcc->sendmsg() can be called concurrently. I'm not sure if it's allowed. Some drivers (eni, nicstar, ...) seem to assume it will never happen. Now pppoatm_send() takes ATM socket lock, the same that is used in vcc_sendmsg() and other ATM socket functions. The pppoatm_send() is called with BH disabled, so bh_lock_sock() is used instead of lock_sock(). Signed-off-by: Krzysztof Mazur <[email protected]> Cc: Chas Williams - CONTRACTOR <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2012-11-28pppoatm: fix module_put() raceKrzysztof Mazur1-2/+7
The pppoatm used module_put() during unassignment from vcc with hope that we have BKL. This assumption is no longer true. Now owner field in atmvcc is used to move this module_put() to vcc_destroy_socket(). Signed-off-by: Krzysztof Mazur <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2012-11-28pppoatm: allow assign only on a connected socketKrzysztof Mazur1-0/+2
The pppoatm does not check if used vcc is in connected state, causing an Oops in pppoatm_send() when vcc->send() is called on not fully connected socket. Now pppoatm can be assigned only on connected sockets; otherwise -EINVAL error is returned. Signed-off-by: Krzysztof Mazur <[email protected]> Cc: Chas Williams - CONTRACTOR <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2012-11-28atm: add owner of push() callback to atmvccKrzysztof Mazur1-0/+2
The atm is using atmvcc->push(vcc, NULL) callback to notify protocol that vcc will be closed and protocol must detach from it. This callback is usually used by protocol to decrement module usage count by module_put(), but it leaves small window then module is still used after module_put(). Now the owner of push() callback is kept in atmvcc and module_put(atmvcc->owner) is called after the protocol is detached from vcc. Signed-off-by: Krzysztof Mazur <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Acked-by: Chas Williams <[email protected]>
2012-11-27mac80211: support P2P GO powersave configurationJohannes Berg2-2/+16
If the low-level driver wants to support P2P GO powersave configuration, it must set the cfg80211 flags and mac80211 will pass the parameters to it. Signed-off-by: Johannes Berg <[email protected]>
2012-11-27nl80211: support P2P GO powersave configurationJohannes Berg1-0/+56
If a driver supports P2P GO powersave, allow it to set the new feature flags for it and allow userspace to configure the parameters for it. This can be done at GO startup and later changed with SET_BSS. Signed-off-by: Johannes Berg <[email protected]>
2012-11-27mac80211: support (partial) VHT radiotap informationJohannes Berg2-0/+42
Add some information that we have about VHT to radiotap. This at least lets one see the MCS and NSS information. Signed-off-by: Johannes Berg <[email protected]>
2012-11-27mac80211: support VHT associationJohannes Berg2-72/+298
Determine the VHT channel from the AP's VHT operation IE (if present) and configure the hardware to that channel if it is supported. If channel contexts cause a channel to not be usable, try a smaller bandwidth. Signed-off-by: Johannes Berg <[email protected]>
2012-11-27cfg80211: rework chandef checking and export itJohannes Berg3-69/+67
Some of the chandef checking that we do in cfg80211 to check if a channel is supported or not is also needed in mac80211, so rework that a bit and export the functions that are needed. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26net: ipmr: limit MRT_TABLE identifiersEric Dumazet1-0/+4
Name of pimreg devices are built from following format : char name[IFNAMSIZ]; // IFNAMSIZ == 16 sprintf(name, "pimreg%u", mrt->id); We must therefore limit mrt->id to 9 decimal digits or risk a buffer overflow and a crash. Restrict table identifiers in [0 ... 999999999] interval. Reported-by: Chen Gang <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26ip6mr: Add sizeof verification to MRT6_ASSERT and MT6_PIMJoe Perches1-0/+6
Verify the length of the user-space arguments. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()Neal Cardwell1-1/+2
inet_getpeer_v4() can return NULL under OOM conditions, and while inet_peer_xrlim_allow() is OK with a NULL peer, inet_putpeer() will crash. This code path now uses the same idiom as the others from: 1d861aa4b3fb08822055345f480850205ffe6170 ("inet: Minimize use of cached route inetpeer."). Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface nameBrian Haley2-6/+79
Instead of having the getsockopt() of SO_BINDTODEVICE return an index, which will then require another call like if_indextoname() to get the actual interface name, have it return the name directly. This also matches the existing man page description on socket(7) which mentions the argument being an interface name. If the value has not been set, zero is returned and optlen will be set to zero to indicate there is no interface name present. Added a seqlock to protect this code path, and dev_ifname(), from someone changing the device name via dev_change_name(). v2: Added seqlock protection while copying device name. v3: Fixed word wrap in patch. Signed-off-by: Brian Haley <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26atm: br2684: Fix excessive queue bloatDavid Woodhouse1-14/+22
There's really no excuse for an additional wmem_default of buffering between the netdev queue and the ATM device. Two packets (one in-flight, and one ready to send) ought to be fine. It's not as if it should take long to get another from the netdev queue when we need it. If necessary we can make the queue space configurable later, but I don't think it's likely to be necessary. cf. commit 9d02daf754238adac48fa075ee79e7edd3d79ed3 (pppoatm: Fix excessive queue bloat) which did something very similar for PPPoATM. Note that there is a tremendously unlikely race condition which may result in qspace temporarily going negative. If a CPU running the br2684_pop() function goes off into the weeds for a long period of time after incrementing qspace to 1, but before calling netdev_wake_queue()... and another CPU ends up calling br2684_start_xmit() and *stopping* the queue again before the first CPU comes back, the netdev queue could end up being woken when qspace has already reached zero. An alternative approach to coping with this race would be to check in br2684_start_xmit() for qspace==0 and return NETDEV_TX_BUSY, but just using '> 0' and '< 1' for comparison instead of '== 0' and '!= 0' is simpler. It just warranted a mention of *why* we do it that way... Move the call to atmvcc->send() to happen *after* the accounting and potentially stopping the netdev queue, in br2684_xmit_vcc(). This matters if the ->send() call suffers an immediate failure, because it'll call br2684_pop() with the offending skb before returning. We want that to happen *after* we've done the initial accounting for the packet in question. Also make it return an appropriate success/failure indication while we're at it. Tested by running 'ping -l 1000 bottomless.aaisp.net.uk' from within my network, with only a single PPPoE-over-BR2684 link running. And after setting txqueuelen on the nas0 interface to something low (5, in fact). Before the patch, we'd see about 15 packets being queued and a resulting latency of ~56ms being reached. After the patch, we see only about 8, which is fairly much what we expect. And a max latency of ~36ms. On this OpenWRT box, wmem_default is 163840. Signed-off-by: David Woodhouse <[email protected]> Reviewed-by: Krzysztof Mazur <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26dsa: Hide core config options; make drivers select what they needBen Hutchings1-17/+13
Commit 82167cb8c6b2f8166d5c7532e5ef4b5e0cc46a72 ('net: dsa/slave: Fix compilation warnings') fixed one possible invalid configuration (NET_DSA enabled with no trailer formats) but added others: drivers can select NET_DSA without its dependencies being met. It's not very useful to make either the DSA core or the tagging formats manually selectable without a driver to use them, so: 1. Define a hidden HAVE_NET_DSA option and move the dependencies of NET_DSA to that. While we're at it, drop the deprecated EXPERIMENTAL dependency. 2. Make NET_DSA and the drivers dependent on HAVE_NET_DSA. 3. Hide the tagging format options again. 4. Make drivers select both NET_DSA and the appropriate tagging format option. Signed-off-by: Ben Hutchings <[email protected]> Acked-by: Randy Dunlap <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-11-26can: bcm: initialize ifindex for timeouts without previous frame receptionOliver Hartkopp1-0/+3
Set in the rx_ifindex to pass the correct interface index in the case of a message timeout detection. Usually the rx_ifindex value is set at receive time. But when no CAN frame has been received the RX_TIMEOUT notification did not contain a valid value. Cc: linux-stable <[email protected]> Reported-by: Andre Naujoks <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
2012-11-26Merge branch 'for-john' of ↵John W. Linville37-885/+1237
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2012-11-26mac80211: fix remain-on-channel (non-)cancellingJohannes Berg1-2/+0
Felix Liao reported that when an interface is set DOWN while another interface is executing a ROC, the warning in ieee80211_start_next_roc() (about the first item on the list having started already) triggers. This is because ieee80211_roc_purge() calls it even if it never actually changed the list of ROC items. To fix this, simply remove the function call. If it is needed then it will be done by the ieee80211_sw_roc_work() function when the ROC item that is being removed while active is cleaned up. Cc: [email protected] Reported-by: Felix Liao <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2012-11-26openvswitch: add skb mark matching and set actionAnsis Atteka4-4/+30
This patch adds support for skb mark matching and set action. Signed-off-by: Ansis Atteka <[email protected]> Signed-off-by: Jesse Gross <[email protected]>
2012-11-26cfg80211: fix some tracing output issuesJohannes Berg1-76/+73
In some cases, e.g. probe_status, there were spaces missing so the trace output was confusing. Also make it more like mac80211 when printing netdevs/wiphys to make reading a combined log easier. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: support VHT rates in TX infoJohannes Berg1-17/+24
To achieve this, limit the number of retries to 31 (instead of 255) and use the three bits that are then free for VHT flags. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: support drivers reporting VHT RXJohannes Berg4-9/+55
Add support to mac80211 for having drivers report received VHT MCS information. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26nl80211/cfg80211: add VHT MCS supportJohannes Berg2-16/+116
Add support for reporting and calculating VHT MCSes. Note that I'm not completely sure that the bitrate calculations are correct, nor that they can't be simplified. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: convert to channel definition structJohannes Berg17-234/+189
Convert mac80211 (and where necessary, some drivers a little bit) to the new channel definition struct. This will allow extending mac80211 for VHT, which is currently restricted to channel contexts since there are no drivers using that which makes it easier. As I also don't care about VHT for drivers not using the channel context API, I won't convert the previous API to VHT support. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26nl80211/cfg80211: support VHT channel configurationJohannes Berg10-94/+382
Change nl80211 to support specifying a VHT (or HT) using the control channel frequency (as before) and new attributes for the channel width and first and second center frequency. The old channel type is of course still supported for HT. Also change the cfg80211 channel definition struct to support these by adding the relevant fields to it (and removing the _type field.) This also adds new helper functions: - cfg80211_chandef_create to create a channel def struct given the control channel and channel type, - cfg80211_chandef_identical to check if two channel definitions are identical - cfg80211_chandef_compatible to check if the given channel definitions are compatible, and return the wider of the two This isn't entirely complete, but that doesn't matter until we have a driver using it. In particular, it's missing - regulatory checks on the usable bandwidth (if that even makes sense) - regulatory TX power (database can't deal with it) - a proper channel compatibility calculation for the new channel types Signed-off-by: Johannes Berg <[email protected]>
2012-11-26cfg80211: pass a channel definition structJohannes Berg13-328/+312
Instead of passing a channel pointer and channel type to all functions and driver methods, pass a new channel definition struct. Right now, this struct contains just the control channel and channel type, but for VHT this will change. Also, add a small inline cfg80211_get_chandef_type() so that drivers don't need to use the _type field of the new structure all the time, which will change. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26cfg80211: remove remain-on-channel channel typeJohannes Berg12-126/+63
As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: fix managed mode channel flags handlingJohannes Berg1-9/+5
If ieee80211_prep_channel() decides that HT should be disabled (because the HT IEs from the AP were invalid) it will set the IEEE80211_STA_DISABLE_HT to not send HT capabilities to the AP when associating. If this happens during authentication, the flag will be lost and we send HT frames, even if the channel config was set up for non-HT. This can lead to issues. Fix this by always resetting the ifmgd flags to zero when the channel context is released so that the flag resetting in ieee80211_mgd_assoc() isn't necessary. To make the code a bit easier move the call to release the channel in ieee80211_set_disassoc() to the end of the function together with the flag resetting (which needs to be at the end to avoid timers setting flags.) Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: remove mesh config macros from mesh_plink.cMarco Porsch1-15/+13
Use shortcut pointer instead where it is appropriate. Signed-off-by: Marco Porsch <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: refactor ieee80211_set_qos_hdrMarco Porsch1-17/+23
Return early if not a QoS Data frame. Give proper documentation. Signed-off-by: Marco Porsch <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2012-11-26mac80211: move Mesh Capability field definition to ieee80211.hMarco Porsch3-19/+5
Signed-off-by: Marco Porsch <[email protected]> [prefix with IEEE80211_] Signed-off-by: Johannes Berg <[email protected]>