Commit Graph

208 Commits (44c581866e2ae4bbc3c8eea5a3e3c7a0f639e12d)

Author SHA1 Message Date
Wey-Yi Guy 07d3c15acc iwlwifi: modify #ifdef to avoid sparse complain
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-05-08 21:53:43 -04:00
Johannes Berg ccc369a6b6 iwlwifi: move TIME_UNIT
We're getting rid of iwl-core.h, move TIME_UNIT out.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-23 14:23:04 -07:00
Johannes Berg 6238b00880 iwlwifi: clean up iwl-shared.h includes
That file is now holding just a few defines and
the module parameters, so it shouldn't include
anything. Make sure the right users include the
right files instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-23 14:21:38 -07:00
Johannes Berg 0e9f6aca34 iwlwifi: move debugfs registration function declarations
They clearly belong into iwl-agn.h as they have no
relation to the (generic) debug logging framework.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-23 14:20:39 -07:00
Johannes Berg 9543c5f3d6 iwlwifi: properly set basic rates
This fixes a long-standing bug: iwlwifi always assumes
that the CCK ACK rates are 1 and 2 MBps and the OFDM
ACK rates are 6, 12 and 24 MBps. Fix this problem by
using the basic rates the AP (or in AP case hostapd)
told us to use and add the necessary mandatory rates
to the mix.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-23 14:20:13 -07:00
David Spinadel c27cf685d1 iwlwifi: Remove inconsistent and redundant declaration
Remove declaration of iwl_alloc_traffic_mem from iwl-agn.h,
from methods that was exposed to support MVM.

MVM doesn't have to use this declaration.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-18 07:32:09 -07:00
Emmanuel Grumbach 4b9844f5d8 iwlwifi: don't use shared for the logger any more
Each modules will hold a pointer to struct device instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-18 07:31:11 -07:00
Emmanuel Grumbach 2152268ff9 iwlwifi: op_mode holds its pointer to the config
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>
2012-04-18 07:29:59 -07:00
Emmanuel Grumbach 68e8dfdadb iwlwifi: op_mode holds its pointer to the transport
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>
2012-04-18 07:29:43 -07:00
Johannes Berg d9fb646580 iwlwifi: remove get_cmd_string
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>
2012-04-16 14:49:56 -07:00
David Spinadel 50c1e9a9e3 iwlwifi: expose static methods for MVM use
To support hybrid state of MVM op_mode, most of the functioanallity
will be done using DVM functions.

When MVM will have independant live, the declarations will be removed
and the functions will be static back.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-16 14:45:10 -07:00
Don Fry 01d651d4b7 iwlwifi: move status definitions from iwl-shared
The code has been changed, move the definitions to the proper file
being used by the code.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-16 14:35:47 -07:00
Meenakshi Venkataraman 8fb96d6e17 iwlwifi: move scan related declarations out of iwl-core.h
Move these as part of iwl-core.h cleanup.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:24:11 -07:00
Meenakshi Venkataraman 1dfdbdd291 iwlwifi: move utility functions out of iwl-core.h
Move these functions to iwl-agn.h as part of
iwl-core.h cleanup.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:23:59 -07:00
Meenakshi Venkataraman 1591129d54 iwlwifi: move iwl_send_statistics_request to iwl-agn.c
Move this 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>
2012-04-12 14:23:21 -07:00
Meenakshi Venkataraman 193219cf0f iwlwifi: move iwlagn_fw_error to iwl-agn.c
Move this 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>
2012-04-12 14:22:26 -07:00
Meenakshi Venkataraman bedec3a67d iwlwifi: move iwl_chswitch_done to iwl-mac80211.c
Move this 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>
2012-04-12 14:22:11 -07:00
Meenakshi Venkataraman aecd44f00f iwlwifi: move iwl_set_rate to iwl-agn-rxon.c
Move this 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>
2012-04-12 14:21:58 -07:00
Meenakshi Venkataraman 47042ac285 iwlwifi: move iwl_connection_init_rx_config to iwl-agn-rxon.c
Move this 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>
2012-04-12 14:21:42 -07:00
Meenakshi Venkataraman 50319f74f5 iwlwifi: move iwl_set_flags_for_band to iwl-agn-rxon.c
Moving this 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>
2012-04-12 14:21:30 -07:00
Meenakshi Venkataraman fedfa87a52 iwlwifi: move iwl_set_rxon_channel to iwl-agn-rxon.c
Moving this 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>
2012-04-12 14:21:17 -07:00
Meenakshi Venkataraman dd64173e37 iwlwifi: move iwl_set_rxon_ht to iwl-agn-rxon.c
Moving this 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>
2012-04-12 14:21:02 -07:00
Meenakshi Venkataraman 5edc565d60 iwlwifi: move iwl_is_ht40_tx_allowed out of iwl-core.c
This is really something determined by
station parameters, so move it to
iwl-agn-sta.c.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:19:39 -07:00
Meenakshi Venkataraman a297d95d53 iwlwifi: move iwl_set_hw_rfkill_state and mark it static
iwl_set_hw_rfkill_state is used only in
iwl-agn.c. Move it there and mark it static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:19:26 -07:00
Meenakshi Venkataraman ae625db3ed iwlwifi: move iwl_free_skb and mark it static
iwl_free_skb is used only in iwl-agn.c, move
it there and mark it static.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:19:05 -07:00
Johannes Berg 4dcba6d3c5 iwlwifi: make iwl_sta_fill_lq static
It's only used in a single place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:18:03 -07:00
Meenakshi Venkataraman d1888db588 iwlwifi: move iwlagn_hw_valid_rtc_data_addr prototype
Since this function is now used only by
op_mode, remove it from iwl-shared.h and move
it to iwl-agn.h.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2012-04-12 14:17:46 -07:00
Johannes Berg e96766958c iwlwifi: dynamically determine lib_ops
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>
2012-04-12 15:10:48 -04:00
Johannes Berg 11483b5c22 iwlwifi: move eeprom into priv
The whole code around eeprom is distributed
across whole bunch of different files, most
of which belong to the to-be-DVM code. As a
result, it is currently very hard to split
out the EEPROM code to be generic. However,
it is also quite unlikely that the current
EEPROM code will be needed by the MVM code
as that has different mechanisms to query
the EEPROM (it does so through the uCode.)

So, at least temporarily, move everything
into priv. If it becomes necessary to use
the code from MVM, we will have to split it
out, but then it's also easier since we'll
know what pieces we need.

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>
2012-04-12 15:06:09 -04:00
Johannes Berg 48dffd397e iwlwifi: split force_reset debugfs file
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>
2012-04-12 15:06:09 -04:00
Don Fry 47107e8444 iwlwifi: split POWER_PMI status bit
Move the POWER_PMI to the op_mode where it is changed.  The trans needs
to check it frequently, so shadow the status in the trans and update it
in trans when it infrequently changes.

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>
2012-04-09 16:37:49 -04:00
Meenakshi Venkataraman 2fdfc476cf iwlwifi: move ucode error log reporting to op_mode
Error log reporting does not belong to the
transport layer, but to the op_mode loading
the ucode, as it is the entity which knows
about the ucode loaded, and what the error
information means.

Move device logging pointers from the
transport layer to op_mode.

With this change, transport layer only
reports an error to the op_mode, which will
figure out what to do with the error. This
causes the driver to now dump out error logs
when the command queue is stuck as well.

Also, move the debugfs entry for event logs
out of the transport layer and into 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>
2012-04-09 16:37:29 -04:00
Meenakshi Venkataraman 19469f47d8 iwlwifi: make iwl_nic_error static
iwl_nic_error is used in iwl-agn.c only, move
it there and make it static.

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>
2012-04-09 16:37:26 -04:00
Meenakshi Venkataraman b7e21bf049 iwlwifi: use iwlagn_fw_error instead of iwl_nic_error
In the process, make iwlagn_fw_error
a non-static function, as it is used
by more than one file.

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>
2012-04-09 16:37:24 -04:00
Johannes Berg 9eae88fa9a iwlwifi: move queue mapping out of transport
The queue mapping is not only dynamic, it
is also dependent on the uCode, as we can
already see today with the dual-mode and
non-dual-mode being different.

Move the queue mapping out of the transport
layer and let the higher layer manage it.
Part of the transport configuration is how
to set up the queues.

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>
2012-04-09 16:37:22 -04:00
Johannes Berg e1f0c501c0 iwlwifi: simplify calibration collection
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>
2012-04-09 16:37:16 -04:00
Johannes Berg 974205153b iwlwifi: don't delete AP station directly
With the mac80211 deauth sequence changes, the
station is deleted before the device is set
unassociated. This can cause the device to get
confused as it expects the station to be there
while the associated bit is set.

To fix this, do not delete the AP station from
the device when mac80211 asks for deletion,
instead just mark it as unused and rely on the
unassociated RXON to drop it from the station
database in the device.

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>
2012-03-08 14:02:29 -05:00
Johannes Berg e6dd5838ac iwlwifi: make iwl_init_context static
It's not needed anywhere but during init.

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>
2012-03-08 14:00:01 -05:00
Don Fry 83626404a7 iwlwifi: more status bit factoring
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>
2012-03-08 13:59:55 -05:00
Don Fry 9a716863ae iwlwifi: separate status to priv and trans
The shared status bits are a mixture of transport and op mode bits.
Some are used just by one or the other, some are shared.  Begin the
de-tangling of these bits.

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>
2012-03-08 13:59:53 -05:00
Johannes Berg 51dc51d12b iwlwifi: make EEPROM enhanced TX power a bool
There's no need to carry around the function
pointer when a boolean indicating that the
EEPROM stores enhanced TX power information
is sufficient.

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>
2012-03-08 13:59:49 -05:00
Johannes Berg e755f882b7 iwlwifi: redesign PASSIVE_NO_RX workaround
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>
2012-03-08 13:59:47 -05:00
Johannes Berg ea886a6014 iwlwifi: remove unused argument from iwlagn_suspend
There's not much point in passing priv and
hw pointers since they can be derived from
each other, and the function doesn't use
the hw pointer anyway. 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>
2012-03-08 13:59:47 -05:00
Johannes Berg 955570fc66 iwlwifi: move iwl_sta_id_or_broadcast to user
There's only one user, so the function
can be moved into the correct file. It
also loses an argument along the way.

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>
2012-03-08 13:59:45 -05:00
Johannes Berg 0e781842cb iwlwifi: virtualize command queue full behaviour
When the command queue is full, the transport
will return -ENOSPC, but the reaction to that
depends on the op_mode. Virtualize that, the
DVM op_mode checks for CT-kill and restarts
the hardware otherwise.

We may be able to get rid of this callback by
putting the behaviour check into the wrapper
but that needs more careful evaluation.

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>
2012-03-07 13:51:52 -05:00
Johannes Berg 84abd2cc06 iwlwifi: move status check functions out of shared
They are only used in the DVM op_mode.
Also move the rfkill debug macros that
depend on 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>
2012-03-07 13:51:51 -05:00
Johannes Berg e10a0533a9 iwlwifi: add wrappers for command sending
Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.

Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.

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>
2012-03-07 13:51:48 -05:00
Johannes Berg 0692fe41b3 iwlwifi: split out firmware store
Through the driver, struct iwl_fw will
store the firmware. Split this out into
a separate file, iwl-fw.h, and make all
other code use it. To do this, also move
the log pointers into it, and remove the
knowledge of "nic" from everything.

Now the op_mode has a fw pointer, and
(unfortunately) for now the shared data
also needs to keep one for the transport
to access dump the error log -- I think
that will move later.

Since I wanted to constify the firmware
pointers, some more changes were needed.

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>
2012-03-07 13:51:47 -05:00
Johannes Berg e19918855d iwlwifi: move ucode loading to op_mode
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>
2012-03-07 13:51:47 -05:00
Johannes Berg ab0bd5b32a iwlwifi: fix station HT parameters
My patch "iwlwifi: simplify auth/assoc flow"
caused a serious throughput degradation due
to me forgetting that there are HT settings
in the station table. To restore throughput,
set these parameters correctly when the sta
moves to assoc state.

This patch should probably be merged with
the auth/assoc redesign patch for upstream.
In that case, this paragraph should be added
to the commit log as the third paragraph
(before talking about RXON):

However, as we only get the station HT data
when the station moves into assoc state, we
also need to program this into the device
(and copy it into our database) then.

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>
2012-03-06 15:16:15 -05:00