summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
AgeCommit message (Collapse)Author
2011-09-21iwlagn: simplify the iwl_device_cmd layoutEmmanuel Grumbach
This simplifies both the transport layer and the upper layer. Kill the union in the device command, which avoids the funny syntax we had: cmd->cmd.payload. 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>
2011-09-21iwlagn: remove the callback in host commandsEmmanuel Grumbach
Before this patch, the upper layer could register a callback for each host command. This mechanism allowed the upper layer to have different callbacks for the same command ID. In fact, it wasn't used and the rx_handlers is enough: same callback for all the command with a specific command ID. The iwl_send_add_station needs the access the command that was sent while handling the response (regardless if the command was sent in SYNC or ASYNC mode). So now, all the handlers receive the host command that was sent. This implies a change in the handler signature. 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>
2011-09-19iwlagn: clean up PM codeJohannes Berg
The transport callbacks might as well be undefined when CONFIG_PM_SLEEP is not set, so ifdef all of it out and make everything available for PM_SLEEP only. 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>
2011-09-19iwlagn: generically provide iwl_trans_send_cmd_pduJohannes Berg
There's no need to have the transport layer have a callback for iwl_trans_send_cmd_pdu() since it is just a generic wrapper around iwl_trans_send_cmd(). 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>
2011-09-19iwlagn: use enum iwl_rxon_context_id instead of u8Emmanuel Grumbach
enum iwl_rxon_context_id is the right type to use when we need a rxon_context_id. 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>
2011-09-14iwlagn: clean up of transport layerEmmanuel Grumbach
Move a few declarations needed by the transport layer to iwl-shared.h Move iwl_cmd_meta, iwl_tx_queue and friends to the internal transport header file. Move iwl_device_cmd iwl_host_cmd and friends to iwl-trans.h since these structs are used in the API to the transport layer. Move get_cmd_string to the upper layer with a declaration in iwl-shared.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>
2011-08-29iwlagn: move the stop / wake queue logic to transport layerEmmanuel Grumbach
priv->mac80211_registered and priv->hw needed to move to shared. stop_queue API was added in order to allow the upper layer to stop the SW queues for regulatory purposes. 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>
2011-08-29iwlagn: move check_stuck_queue to transport layerEmmanuel Grumbach
This one is really transport related. ==== moves Stanislaw's code to BSD area ==== 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>
2011-08-29iwlagn: move wait_for_tx_queue_empty to transport layerEmmanuel Grumbach
This one is really transport related. 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>
2011-08-29iwlagn: cosmetics in iwl-trans.hEmmanuel Grumbach
Remove a few dereferences of priv from the transport layer while at it. 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>
2011-08-29iwlagn: move the disable agg logic to transport layerEmmanuel Grumbach
Since all the check_empty logic is now in the transport layer, the upper layer doesn't need to know anything about tx queues. The disable aggregation flow was the last to know what a tx queue is, so move it too. 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>
2011-08-29iwlagn: move the check_empty logic to the transport layerEmmanuel Grumbach
This logic is responsible to tell mac80211 when the HW queues are empty and the BA session can be started / torn down. Fix a bug on the way: When the the Tx BA session is stopped and the HW queues aren't empty, we stop the SW queue to drain the HW queue and then switch to the legacy HW queue. This is the IWL_EMPTYING_HW_QUEUE_DELBA state. While in this state, we never wake the SW queue, even when the HW queue is almost empty, since we need to drain it completely. Look at iwl_trans_pcie_reclaim regarding this. Once the HW queue is really empty, we must wake the SW queue in order to get traffic to the legacy queue. This step was missing leading to an odd situation were the traffic would just stall after we tore down a Tx BA session while the HW queue was not empty. 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>
2011-08-29iwlagn: allocate resources for TX BA session in transportEmmanuel Grumbach
The queues and all the related logic suits to the transport layer. 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>
2011-08-29iwlagn: move the mapping ac to queue / fifo to transportEmmanuel Grumbach
This mapping is transport related. This allows us to remove the notion of tx queue from the tx path in the upper layer. iwl_wake_any_queue moved to transport layer since it needs to access these mappings. The TX API is nicer now: int (*tx)(struct iwl_trans *trans, struct sk_buff *skb, struct iwl_device_cmd *dev_cmd, u8 ctx, u8 sta_id); 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>
2011-08-29iwlagn: upper layer uses slabs to allocate tx cmdsEmmanuel Grumbach
In a near future, the upper layer won't be aware of the tx queues. This allows to remove one place where the upper layer needed to provide the tx queue index to the transport layer. This also saves around 1.5MB. 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>
2011-08-29iwlagn: set tx_fifo for ampdu in transport layerEmmanuel Grumbach
the mapping tx_queue -> fifo is really transport related. The upper layer should be involved in such things. Note that upon agg_disable, the queue is always mapped to fifo 0, but this doesn't matter since when the queue will be setup again for a new BA session, it will be configured to the good fifo anyway. 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>
2011-08-29iwlagn: upper layer stores iwl_rxon_context in skb's CBEmmanuel Grumbach
This removes the need for iwl_tx_info. Each tx queue holds an array of skbs, the transport layer doesn't need to know anything about the context in which a specific skb is sent. 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>
2011-08-29iwlagn: stop the device before freeing itEmmanuel Grumbach
When we remove the module, we free all the tx and rx resources. Before doing that, we'd better stop the tx / rx activity. Calling iwl_trans_stop_device in iwl_remove helps also to remove a few API functions: * rx_free: happens in iwl_trans_free * tx_free: happens in iwl_trans_free * disable_sync_irq: happens in iwl_trans_stop_device 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>
2011-08-29iwlagn: add missing includesEmmanuel Grumbach
a few h files weren't self contained. Fix that. Move iwl_dma_ptr to transport layer since it is not used by the upper layer any more. 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>
2011-08-29iwlagn: move hcmd_lock to transport layerEmmanuel Grumbach
Since it is needed for host commands only, it is needed in transport layer only 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>
2011-08-29iwlagn: transport layer should receive iwl_transEmmanuel Grumbach
Change a lot of functions to have them receive iwl_trans and not iwl_priv. 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>
2011-08-29iwlagn: move reclaim related functionsEmmanuel Grumbach
Now that the reclaim flow has been moved to the transport layer, a lot of functions can be made static or don't need to be exported outside the transport layer. 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>
2011-08-29iwlagn: reclaim the packets in transport layerEmmanuel Grumbach
The reclaim flow is really transport related. Define a simple API to allow the upper layer to request from the transport layer to reclaim packets until an index written in the Tx response / BA notification. The transport layer prepares a list of the packets that are being freed and passes this list to the upper layer. Between the two layers, the CB of the skb is used to pass a pointer to the context (BSS / PAN) in which the skb was sent. 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>
2011-08-29iwlagn: move ISR related data to transport layerEmmanuel Grumbach
Since the ISR is entirely in the transport layer, its data should be in the pcie specific region. Change sync_irq to first disable and then synchronize the IRQ. iwl_isr and iwl_isr_ict now receive iwl_trans. 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>
2011-08-29iwlagn: move iwl_suspend / iwl_resume to the transport layerEmmanuel Grumbach
These flows needs to access the APM and a few other registers that can differ between different transports. 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>
2011-08-29iwlagn: iwl_rx_queue moves to the iwl_trans_pcieEmmanuel Grumbach
Since this struct is specific to pcie transport, move it the the pcie specific transport layer. 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>
2011-08-29iwlagn: transport handler can register debugfs entriesEmmanuel Grumbach
Add a handler in iwl_trans_ops to allow it to add entries under debugfs dir given by the upper level. 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>
2011-08-29iwlagn: add comments to iwl_bus / iwl_transEmmanuel Grumbach
Rename the recursive inclusion protection in iwl-bus.h while we are at it. 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>
2011-08-29iwlagn: bus layer chooses its transport layerEmmanuel Grumbach
Remove iwl_transport_register which was a W/A. The bus layer knows what transport to use. So now, the bus layer gives the upper layer a pointer to the iwl_trans_ops struct that it wants to use. The upper layer then, allocates the desired transport layer using iwl_trans_ops->alloc function. As a result of this, priv->trans, no longer exists, priv holds a pointer to iwl_shared, which holds a pointer to iwl_trans. This required to change all the calls to the transport layer from upper layer. While we were at it, trans_X inlines have been renamed to iwl_trans_X to avoid confusions, which of course required to rename the functions inside the transport layer because of conflicts in names. So the static API functions inside the transport layer implementation have been renamed to iwl_trans_pcie_X. Until now, the IRQ / Tasklet were initialized in iwl_transport_layer. This is confusing since the registration doesn't mean to request IRQ, so I added a handler for that. 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>
2011-07-21iwlagn: transport layer receives struct iwl_trans*Emmanuel Grumbach
It still holds a pointer to iwl_priv. But hopefully this will disappear at some point. Also add the multiple inclusion protection to iwl-trans.h that was forgotten. Move iwl-trans structures to iwl-trans.h Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: move iwl_prepare_card_hw to the transport layerEmmanuel Grumbach
This function is really related to the transport layer - move it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: move more functions from the start flow to the transport layerEmmanuel Grumbach
Basically all the nic_init flow should be in the transport layer. iwl_prepare_card_hw will move to the transport too in a separate patch. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: SCD configuration for AMPDU moves to transport layerEmmanuel Grumbach
All the configurations of the HW for AMPDU are now in the transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-21iwlagn: add kick_nic API to transport layerEmmanuel Grumbach
kick_nic means to remove the RESET bit from the embedded CPU Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
2011-07-16iwlagn: add tx start API to transport layerEmmanuel Grumbach
tx start will start the tx queues: basically configure the SCD Remove the IWLAGN prefix to SCD defines on the way. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
2011-07-16iwlagn: move iwlagn_stop_device to transport layerEmmanuel Grumbach
Since iwlagn_stop_device was the only caller to the rx_stop / tx_stop, these two don't need to be API any more. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
2011-07-16iwlagn: move tx transport functions to iwl-trans-tx-pcie.cEmmanuel Grumbach
There are still a few functions here and there that should be put in the transport layer. Mainly the functions that are related to the reclaim flow. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move sync_irq to transport layerEmmanuel Grumbach
Since all the irq / tasklet is now handled in the transport layer, it should give an API to ensure that all the irq / tasklet have finished running. This will allow the upper layer to release all its resources. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move the tasklet / irq to the transport layerEmmanuel Grumbach
PCIe doesn't provide any ISR registration API, whereas other buses do. Hence, we need to move the tasklet and irq to the transport layer to allow this flexibility. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-16iwlagn: move Tx datapath to transport layerEmmanuel Grumbach
Split the Tx datapath in two parts: * the first deals with the Tx cmd composition * the second attaches the skb + Tx cmd to the queues Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-07-11iwlagn: provide heplers to access the transport opsEmmanuel Grumbach
This removes the for priv->trans.ops->... 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>
2011-07-01iwlagn: introduce transport layer and implement rx_initEmmanuel Grumbach
The transport layer is responsible for all the queues, DMA rings etc... This is the beginning of the separation of all the code that is tighly related to HW design to the aforementioned transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>