summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-05-071-7/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/ethernet/intel/e1000e/param.c drivers/net/wireless/iwlwifi/iwl-agn-rx.c drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c drivers/net/wireless/iwlwifi/iwl-trans.h Resolved the iwlwifi conflict with mainline using 3-way diff posted by John Linville and Stephen Rothwell. In 'net' we added a bug fix to make iwlwifi report a more accurate skb->truesize but this conflicted with RX path changes that happened meanwhile in net-next. In e1000e a conflict arose in the validation code for settings of adapter->itr. 'net-next' had more sophisticated logic so that logic was used. Signed-off-by: David S. Miller <davem@davemloft.net>
| * iwlwifi: fix skb truesize underestimationEric Dumazet2012-05-031-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, iwlwifi uses order-1 pages (8 KB) to store incoming frames, but doesnt say so in skb->truesize. This makes very possible to exhaust kernel memory since these skb evade normal socket memory accounting. As struct ieee80211_hdr is going to be pulled before calling IP stack, there is no need to use dev_alloc_skb() to reserve NET_SKB_PAD bytes. alloc_skb() is ok in this driver, allowing more tailroom. Pull beginning of frame in skb header, in the hope we can reuse order-1 pages in the driver immediately for small frames and reduce their truesize to the minimum (linear skbs) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Neal Cardwell <ncardwell@google.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: clean up module parametersJohannes Berg2012-04-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | For now at least, all module parameters should be with the core functionality, so move them there, while at it rename to iwlwifi_mod_params. Also rename iwl-shared.h to iwl-modparams.h to reflect the real contents. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: remove TX/RX frame statisticsJohannes Berg2012-04-231-3/+0
| | | | | | | | | | | | | | | | | | | | Keeping statistics per frame type really isn't very useful, and needs a huge amount of code so remove it. Since that is the only thing in iwl-core.{c,h} now, those files can be killed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: remove traffic logJohannes Berg2012-04-231-1/+0
| | | | | | | | | | | | | | This is superseded by tracing and no longer needed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: remove unneeded includesEmmanuel Grumbach2012-04-181-1/+0
| | | | | | | | | | Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: op_mode holds its pointer to the configEmmanuel Grumbach2012-04-181-1/+1
| | | | | | | | | | | | | | Instead of using the shared area that we be killed. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: op_mode holds its pointer to the transportEmmanuel Grumbach2012-04-181-5/+5
| | | | | | | | | | | | | | Instead of using the shared area that we be killed. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: remove get_cmd_stringJohannes Berg2012-04-161-90/+85
| | | | | | | | | | | | | | | | | | | | The command strings are needed through the layers for debug and error messages, but can differ with opmode. As a result, we need to give the command names to the transport layer as configuration. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: move iwl_force_rf_reset to iwl-agn-rx.cMeenakshi Venkataraman2012-04-121-0/+39
| | | | | | | | | | | | | | Move this function as part of iwl-core.c cleanup. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* | iwlwifi: dynamically determine lib_opsJohannes Berg2012-04-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the pointer to lib_ops in the config makes it impossible to split the driver into different modules. Determine the ops based on the device family enumeration to get rid of the direct pointer. Also move all the opmode specific code from the iwl-[1256]000.c files into a new file iwl-agn-devices.c so that the former only have configuration data now. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: split force_reset debugfs fileJohannes Berg2012-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the force_reset debugfs file into two different files: * "rf_reset" triggers a reset of the RF when written to and exposes statistics on RF resets when read * fw_restart triggers a firmware restart when written to and lives in the transport This cleans up all sources of firmware restart to originate within the transport layer and allows us to simplify some code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: remove ack_check module parameterJohannes Berg2012-04-121-69/+0
| | | | | | | | | | | | | | | | | | This defaults to false, and we don't recommend to use it anywhere, so just remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: add trailing newline to various messagesJohannes Berg2012-04-091-1/+1
| | | | | | | | | | | | | | | | | | A whole bunch of messages, even some recent ones, didn't include a trailing newline so add it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: simplify calibration collectionJohannes Berg2012-04-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calibration results all come in while we're waiting for the calibration complete notification. As a consequence, there's no need to install a global RX handler for them, we can use the newly extended notification wait framework for this and make the code easier to follow. It is now quite explicit that we are processing the calibration results while waiting for the complete notification, before this was implicit and developers had to know this to understand why we wait for the calibration complete notification and what happens while we wait. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | iwlwifi: process multiple frames per RXBJohannes Berg2012-04-091-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | The flow handler (hardware) can put multiple frames into a single RX buffer. To handle this, walk the RX buffer and check if there are multiple valid packets in it. To let the upper layer handle this correctly introduce rxb_offset() which is needed when we pass pages to mac80211 -- we need to know the offset into the page there. Also change the page handling scheme to use refcounting. Anyone who needs a page will "steal" it, which marks it as having been used & refcounts it. The RX handler then has to free its own reference and must not reuse the page. Finally, do not set the bit asking the FH to give us each packet in a single buffer. This really enables the feature. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: add a truesize parameter to skb_add_rx_frag()Eric Dumazet2012-03-251-1/+1
| | | | | | | | | | | | | skb_add_rx_frag() API is misleading. Network skbs built with this helper can use uncharged kernel memory and eventually stress/crash machine in OOM. Add a 'truesize' parameter and then fix drivers in followup patches. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* iwlwifi: move wait_command_queue from shared to transMeenakshi Venkataraman2012-03-121-1/+1
| | | | | | | | | | | | | | This wait queue really belongs to the transport layer, as it is used for sending synchronous commands to the HW. However, only op_mode knows about errors and exceptional conditions, so make this queue accessible by the op_mode. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: correct status bit refactoring errorsDon Fry2012-03-081-1/+1
| | | | | | | | | I missed a couple of status bits in my refactoring changes. This fixes the ones I missed. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: more status bit factoringDon Fry2012-03-081-9/+9
| | | | | | | | | Continue splitting the status bits between transport and op_mode. All but a few are separated. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: add testmode command for rx forwardingAmit Beka2012-03-081-4/+16
| | | | | | | | | | | | | Added a testmode command which tells iwl_rx_dispatch to send the RX both as a notification to nl80211 and with the registered RX handlers. This is used for monitoring RX from userspace while preserving the regular flows in the driver. Signed-off-by: Amit Beka <amit.beka@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: remove BT handlers from lib_opsJohannes Berg2012-03-081-3/+2
| | | | | | | | | | | | | There's no need to have operations for these as they simply depend on whether the device has built-in bluetooth, so just duplicate the information already there (whether bt_params is present or not). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: redesign PASSIVE_NO_RX workaroundJohannes Berg2012-03-081-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The PASSIVE_NO_RX workaround currently crosses through the op_mode and transport layers, which is a bit odd. This also isn't necessary, if the transport simply reports when queues are full (or no longer full) the op_mode can keep track of this state, and report to mac80211 only what *it* thinks is appropriate. What is appropriate can then be based on whether queues should be stopped to wait for RX or not. This significantly simplifies the transport API, it no longer needs to expose anything to stop a queue, nor to wake "any" queue, this can all be handled in the upper layer completely. Also simplify the handling to not be dependent on the context, that makes little sense as the queues are shared and both contexts have to be on the same channel anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move packet to transportJohannes Berg2012-03-071-24/+26
| | | | | | | | | | | | | The base packet structure will (hopefully) be the same for all transports, but what is in it differs. Remove the union of all the possible contents and move the packet itself into the transport header file. This requires changing all users of the union to just use pkt->data. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move ucode_owner to privJohannes Berg2012-03-071-1/+1
| | | | | | | | | | | The transport doesn't really need to know as we can enforce it in the command wrapper. Move the ucode_owner variable into priv and do all enforcing there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: abstract out notification wait supportJohannes Berg2012-03-071-22/+2
| | | | | | | | | | | | | | This will be sharable, but needs to live in the op_mode as it is dependent on command processing. Make a library out of the notification wait code. Since I wrote all of the code originally and only Intel employees changed it, we can also relicense it to dual BSD/GPL. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: keep plcp_delta_threshold in privJohannes Berg2012-03-071-1/+1
| | | | | | | | | The base_params shouldn't be writable, so keep a copy of this in priv that can be modified. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move ucode loading to op_modeJohannes Berg2012-03-071-1/+1
| | | | | | | | | | | | | | uCode loading belongs to the op_mode, as it is dependent on various things there and the commands sent during it are specific to it. Move the prototypes to iwl-agn.h to indicate this. To make this possible, also move all the calibration handling (which is op_mode dependent after all). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: don't pass iwl_rx_mem_buffer to upper layersJohannes Berg2012-03-061-19/+22
| | | | | | | | | | | | | | | | struct iwl_rx_mem_buffer implementation details (DMA address, list pointers) that the upper layers don't need. Introduce iwl_rx_cmd_buffer that is passed upstream and only contains the needed data (the page). Additionally, access this data only via accessor functions, allowing us to change the implementation in the future. These accessors are rxb_addr() (as before) and rxb_steal_page() to take ownership of the data. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: introduce statistics lockJohannes Berg2012-03-061-0/+8
| | | | | | | | | | The statistics are currently only half-heartedly locked against concurrent reading & modification so introduce a lock to really protect them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: virtualize op_mode's rxEmmanuel Grumbach2012-02-271-1/+2
| | | | | | | This is the op_mode's Rx handler. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move workqueue to privJohannes Berg2012-02-171-1/+1
| | | | | | | | | | | In order to separate the different parts of the driver better, we are reducing the shared data. This moves the workqueue to "priv", and removes it from the transport. To do this, simply use schedule_work() in the transport. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: give trans to all the read / write functionsEmmanuel Grumbach2012-02-021-4/+4
| | | | | | | | | From now on, the transport layer in charge of providing access to the device. So change all the driver to give a pointer to the transport to all the low level functions that actually access the device. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: update CopyrightWey-Yi Guy2012-01-061-1/+1
| | | | | | Update Copyright to 2012 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: don't process the info from uCode if does not has ownershipWey-Yi Guy2012-01-061-13/+15
| | | | | | | When enable the testmode from user space and working with uCode, driver does not own the uCode and should not process the notifications or pkts from uCode Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move iwl_cfg from iwl_priv to iwl_sharedDon Fry2011-12-161-5/+5
| | | | | | | | Move the configuration pointer from the upper level iwl_priv to the lower level iwl_shared structure, with associated code fixes. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move device_pointers from iwl_priv to iwl_sharedDon Fry2011-12-081-1/+1
| | | | | | | Move the low level ucode device_pointers structure to iwl_shared. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: move ucode notification from iwl_priv to iwl_sharedDon Fry2011-12-021-8/+8
| | | | | | | | | Move the notification structures for ucode operations from the iwl_priv structure to the iwl_shared structure, with associated code changes. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: show command string for REPLY_D3_CONFIGWey-Yi Guy2011-11-251-0/+1
| | | | | | missing the string, add it Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlwifi: add debug information on queue stop / wakeEmmanuel Grumbach2011-11-111-1/+2
| | | | | | | | | Users complain that the traffic gets stalled sometimes. This will allow easier debugging. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlagn: add P2P NoA to probe responsesJohannes Berg2011-11-111-0/+46
| | | | | | | | | | | | | | | | Whether to use NoA or not is entire controlled by the uCode right now, and it also adds the attribute to beacons. We do need to add it to probe responses in the driver though. Keep track of the NoA notification from the uCode and add the data to probe responses when such are transmitted. Use RCU to manage the lifetime. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlagn: move iwl_enable_rfkill_int and kill iwl-helpers.hEmmanuel Grumbach2011-10-141-2/+1
| | | | | | | | | Move iwl_enable_rfkill_int to iwl-core.h, and remove the empty iwl-helpers.h Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlagn: rename iwl-rx.c to iwl-agn-rx.cWey-Yi Guy2011-10-141-0/+1144
| | | | | | | | After driver split, there were no shared functions between agn and legacy; rename iwl-rx.c to iwl-agn-rx.c Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.cStanislaw Gruszka2011-02-281-264/+0
| | | | | | | | | There is no need to have separate iwl-agn-rx.c file after iwlegacy split. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: move check health code into iwl-rx.cStanislaw Gruszka2011-02-281-87/+0
| | | | | | | | | | Remove check_plcp_health and check_ack_health ops methods, they are unneeded after iwlegacy driver split. Merge check health code into to iwl-rx.c and make functions static. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: introduce iwl_bt_statisticsStanislaw Gruszka2011-01-281-10/+5
| | | | | | | | | We use priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics conditional in few places, merge it into one function. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: clean up declarationsJohannes Berg2010-10-071-1/+1
| | | | | | | | | | A number of declarations in iwl-core.h should be in agn specific files, and also rename the iwl-calib.h file to iwl-agn-calib.h to better reflect that it belongs to agn. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: reduce redundant parameter definitionsWey-Yi Guy2010-10-061-14/+19
| | | | | | | | | | | | | move paramater definitions to a device paramater structure only leaving the device name, which antennas are used and what firmware file to use in the iwl_cfg structure. this will not completely remove the redundancies but greatly reduce them for devices that only vary by name or antennas. the parameters that are more likely to change within a given device family are left in iwl_cfg. also separate bt param structure added to help reduce more. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: Add support for bluetooth statistics notificationWey-Yi Guy2010-07-231-50/+117
| | | | | | | | WiFi/BT combo devices has different statistics notification structure, adding the support here to make sure the structure align correctly. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: add statistic notification structure for WiFi/BT devicesWey-Yi Guy2010-07-231-8/+8
| | | | | | | | | If its WiFi/BT combo device, the statistics notification sent by uCode will include the additional BT related statistics counters. Adding new data structure to support the new layout. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
OpenPOWER on IntegriCloud