summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-io.h
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: update nmi registerLiad Kaufman2014-05-151-0/+1
| | | | | | | | | | | In the 8000 HW family the register for forcing an NMI has changed, so this allows to still be able to force an NMI while taking into account the HW in order to write to the correct register. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: pcie: enable LP XTAL to reduce power consumptionAlexander Bondar2014-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Enable LP XTAL to avoid HW bug where device may consume much power if FW is not loaded after device reset. LP XTAL is disabled by default after device HW reset. Configure device's "persistence" mode to avoid resetting XTAL again when SHRD_HW_RST occurs in S3. 2. Add methods to access SHR (shared block memory space) directly from PCI bus w/o need to power up MAC HW. Shared internal registers (e.g. SHR_APMG_GP1, SHR_APMG_XTAL_CFG)can be accessed directly from PCI bus through SHR arbiter even when MAC HW is powered down. This is possible due to indirect read/write via HEEP_CTRL_WRD_PCIEX_CTRL (0xEC) and HEEP_CTRL_WRD_PCIEX_DATA (0xF4) registers. Use iwl_write32()/iwl_read32() family to access these registers. The MAC HW need not be powered up so no "grab inc access" is required. For example, to read from SHR_APMG_GP1 register (0x1DC), first, write to the control register: HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register) HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 2 (read access) second, read from the data register HEEP_CTRL_WRD_PCIEX_DATA[31:0]. To write the register, first, write to the data register HEEP_CTRL_WRD_PCIEX_DATA[31:0] and then: HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register) HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 3 (write access) Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: pcie: fix secure section / dual cpu firmware loadingEran Harary2014-02-031-0/+2
| | | | | | | | Also handle the bypass mode in which the second CPU doesn't interfere. Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: Update Copyright to 2014Emmanuel Grumbach2013-12-311-1/+1
| | | | | | Happy new year! Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: move dump_fh into common codeInbal Hacohen2013-07-161-0/+3
| | | | | | | | | This means it can be shared for different transport layers in the future. Signed-off-by: Inbal Hacohen <Inbal.Hacohen@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
* iwlwifi: add iwl_set_bits_mask to transport APILilach Edelstein2013-02-011-5/+8
| | | | | | | | | | Express iwl_set_bit() and iwl_clear_bit() through iwl_set_bits_mask() and add the latter to the transport's API in order to allow different implementation for different transport types in the future. Signed-off-by: Lilach Edelstein <lilach.edelstein@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: update copyrightJohannes Berg2013-01-241-1/+1
| | | | | | | Update Copyright notices to 2013. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: virtualize SRAM accessEmmanuel Grumbach2013-01-031-15/+0
| | | | | | | | Different transports implement the access to the SRAM in different ways. Virtualize it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: virtualize iwl_{grab,release}_nic_accessEmmanuel Grumbach2013-01-031-4/+2
| | | | | | | | Since different transports have different ways to wake the up the NIC, we need to virtualize it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: move prph handling into the transportEmmanuel Grumbach2012-12-061-5/+5
| | | | | | | | | | | | | New transports may handle it internally for better performance. Also move the tracing inside PRPH access which will make the output more readable: iwlwifi_dev_ioread_prph32: Read 0x0 from SCD_AGGR_SEL (32-bit) instead of the corresponding accesses to HBUS_TARG_PRPH_*. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: wipe out the status of the SCD when we disable a queueEmmanuel Grumbach2012-10-161-1/+1
| | | | | | | | | | | | When we disable a queue, we don't want the SCD to remember anything about this queue (what packet was transmitted but not acked, what packed was acked etc...). Wipe out all this data in its SRAM. Constify the arguments to iwl_write_targ_mem_dwords on the way. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: iwl_{read,write}_targ_mem_words takes dwordsEmmanuel Grumbach2012-06-131-6/+6
| | | | | | | Change its name to better reflect this. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: s/iwl_read_targ_mem_words/iwl_read_targ_mem_bytesEmmanuel Grumbach2012-06-131-1/+1
| | | | | | | This macro gets the bufsize in bytes. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: add iwl_set_bits_maskJohannes Berg2012-06-061-0/+2
| | | | | | | | | | In a few cases we need to set a value in a certain mask inside a register, add the function iwl_set_bits_mask() to make such code easy. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@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: always check if got h/w access before writeStanislaw Gruszka2012-03-081-1/+1
| | | | | | | | | | | | | Before we write to the device registers always check if iwl_grap_nic_access() was successful. On the way change return type of grab_nic_access() to bool, and add likely()/unlikely() statement. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> 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: make tracing use device as identifierJohannes Berg2012-03-071-3/+3
| | | | | | | | | | | | | | Tracing used the priv pointer as an identifier, which has the problem that we don't have it in all code, and also some people say no pointers should be "leaked" to userspace. Use the device name instead, it is more useful 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: give trans to all the read / write functionsEmmanuel Grumbach2012-02-021-34/+29
| | | | | | | | | 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: the read / write register ops move to transportEmmanuel Grumbach2012-02-021-3/+8
| | | | | | | Most of the accesses to the registers are done from the transport layer. 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: add IO function for continuous write of target memoryHsu, Kenny2011-12-161-1/+4
| | | | | | | | | | | | Add new IO function _iwl_write_targ_mem_words() to support target memory write for a continuous area. It will return error code -EBUSY if iwl_grab_nic_access() fails to indicate the memory write does not be performed. Meanwhile the existing function iwl_write_targ_mem() also been updated by using _iwl_write_targ_mem_words() in a single word case. Signed-off-by: Kenny Hsu <kenny.hsu@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: all function iwl-io.c receive iwl_busEmmanuel Grumbach2011-08-291-32/+29
| | | | | | | | Which means that iwl-io.c doesn't need to include iwl-dev.h 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>
* iwlagn: simplify the bus architectureEmmanuel Grumbach2011-07-211-3/+4
| | | | | | | | | | | | | | | | | | | Call iwl_probe with a ready iwl_bus struct. This means that the bus layer assigns the irq, dev and iwl_bus_ops pointers to iwl_bus before giving it to iwl_probe. The device specific struct is allocated together with the common iwl_bus struct by the bus specific layer. The pointer to the aggregate struct is passed to the upper layer that holds a pointer to iwl_bus instead of an embedded iw_bus. The private data given to the PCI subsystem is now iwl_bus and not iwl_priv. Provide bus_* inliners on the way in order to simplify the syntax. Rename iwl-pci.h -> iwl-bus.h since it is bus agnostic and represent the external of the bus layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: move PCI related operations from probe and remove to PCI layerEmmanuel Grumbach2011-06-181-3/+3
| | | | | | | | | | | Since we have now a PCI layer, all the init and deinit code that is PCI related should move to there. Also move the IO functions: read8/read32/write32. They need hw_base which is killed from priv. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: introduce silent grabbing of NIC accessJohannes Berg2011-04-301-0/+1
| | | | | | | | | | | | | | | There are a few cases like the WoWLAN support I'm writing that require attempting to access the NIC when it is known that it might not be accessible, e.g. after the system woke up and the platform might have reset the device. To avoid messages in this case, introduce the new function iwl_grab_nic_access_silent(), it will only return an error status. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: simplify error table readingJohannes Berg2011-04-221-0/+10
| | | | | | | | | | | | | | The current code to read the error table header just hardcodes all the offsets, which is a bit hard to understand. We can read in the entire header (as much as we need) into a structure, and then take the data from there, which makes it easier to understand. To read a bigger blob we also don't need to grab NIC access for each word read, making the code more efficient. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
* iwlagn: move IO functions out of lineJohannes Berg2011-04-071-468/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This generates a massive reduction in module size: with debug: text data bss dec hex filename 670300 13136 420 683856 a6f50 iwlagn.ko (before) 388347 13136 408 401891 621e3 iwlagn.ko (after) without debug: text data bss dec hex filename 528575 13072 420 542067 84573 iwlagn.ko (before) 294192 13072 408 307672 4b1d8 iwlagn.ko (after) This also removes all the IO debug functionality since it can easily be replaced by tracing, and makes the code unnecessarily complex. I haven't done any CPU utilisation measurements, but given that the hotpaths don't use much IO it is not likely to have a negative impact; in fact, the size reduction will reduce cache pressure which possibly improves performance. Finally, an unused function or two were removed. 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: change Copyright to 2011Wey-Yi Guy2011-04-071-1/+1
| | | | | Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2010-04-151-1/+1
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: Documentation/feature-removal-schedule.txt drivers/net/wireless/ath/ath5k/phy.c drivers/net/wireless/wl12xx/wl1271_main.c
| * iwlwifi: remove trailing space in messagesFrans Pop2010-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | Includes minor improvements in debugging messages in iwl-4965.c, function iwl4965_is_temp_calib_needed(). Signed-off-by: Frans Pop <elendil@planet.nl> Cc: Zhu Yi <yi.zhu@intel.com> Cc: Reinette Chatre <reinette.chatre@intel.com> Cc: Intel Linux Wireless <ilw@linux.intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
* | iwlwifi: don't include iwl-dev.h from iwl-devtrace.hTejun Heo2010-03-301-0/+1
|/ | | | | | | | | | | | | | | iwl-devtrace.h is used to declare and define trace points and including iwl-dev.h from the file, which in turn includes other generic headers, can lead to problems like generating duplicate copies of generic trace points depending on the order of includes. Don't include iwl-dev.h from iwl-devtrace.h but include it from its users - iwl-io.h and iwl-devtrace.c. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Cc: Zhu Yi <yi.zhu@intel.com> Cc: Intel Linux Wireless <ilw@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com>
* iwlwifi: update copyright year to 2010Reinette Chatre2010-01-191-1/+1
| | | | | Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: Add iwl_write8()Ben Cahill2009-11-231-0/+20
| | | | | | | | | To support byte writes to CSR_INT_COALESCING and CSR_INT_PERIODIC registers, add iwl_write8(), including debug/trace support. Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: Add comments about MAC_ACCESS_REQBen Cahill2009-11-111-0/+20
| | | | | | Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: device tracingJohannes Berg2009-10-071-2/+14
| | | | | | | | | | | | | | | | In order to have an easier way to debug issues, create trace events (using the ftrace framework) that will allow us to follow exactly what the driver is doing with the device. The text format isn't all that useful, but the binary format can also be obtained easily via debugfs and then analysed on the fly or offline with debugging tools. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlcore: register locksMohamed Abbas2009-05-221-94/+159
| | | | | | | | | | | | | | | Add new lock to be used when accessing some registers. Also move the register lock and iwl_grab_nic_access inside the function for register access. This will prevent from forgetting to hold locks and nic access in the right way and make code easier to maintain. We over use the priv->lock spin lock and I guess we need to add new one for Tx queue after that we might need to change most of these lock to BH and just keep priv->lock as irq type. Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: print contents of control register when error occursReinette Chatre2009-03-161-1/+3
| | | | | | | hopefully the register contents will guide us to why this failure occured Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: don't use implicit priv in IWL_DEBUGTomas Winkler2009-02-091-10/+10
| | | | | | | | | Call IWL_DEBUG macro with explicit priv argument. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwl3945: fix deep sleep when removing the driver.Abbas, Mohamed2009-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | A warning message "MAC is in deep sleep" sometimes happen when user removes the driver. This warning is related to card not being ready. In __iwl3945_down function some of the going down steps are in wrong order, to fix this this patch do the following: 1- make sure we are calling iwl3945_apm_reset and iwl3945_apm_stop in the right order. 2- make sure we set CSR_GP_CNTRL_REG_FLAG_INIT_DONE in apm_reset before poll on CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY. 3- set correct polling counter. This fixes bug http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1834 Signed-off-by: mohamed abbas <mohamed.abbas@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: update copyright year to 2009Reinette Chatre2009-01-291-1/+1
| | | | | Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: replace IWL_ERROR with IWL_ERRWinkler, Tomas2009-01-291-9/+9
| | | | | | | | IWL_ERR doesn't use hidden priv pointer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: use meaningful vars in _iwl_poll_bit()Wu, Fengguang2008-12-191-5/+6
| | | | | | | | Rename vars in _iwl_poll_bit() to better reflect the truth. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: change email contact informationWinkler, Tomas2008-12-121-1/+1
| | | | | | | | | | This patch replaces personal emails with hopefully always valid Intel Linux Wireless, which will be routed to a current maintainer Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: use rmb/wmb to protect indirect mmio operationZhu, Yi2008-12-121-0/+5
| | | | | | | | | | This patch protects iwlwifi indirect mmio operations with rmb() and wmb(). It makes sure CPU reordering won't affect our indirect mmio access. Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: iwl_poll_{direct_}bit cleanupZhu, Yi2008-12-121-12/+3
| | | | | | | | | | The patch merges implementation of iwl_poll_bit() and iwl_poll_direct_bit() by letting the latter be a special case of the former. Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: fix time interval misuse in iwl_poll_{direct_}bitZhu, Yi2008-12-121-2/+2
| | | | | | | | | | | | The patch fixes the misuse of microsecond with millisecond in the polling mechanism of the iwlwifi driver. The impact of this problem is the unacceptable latency for the whole system (especially during bringing down the wlan interface). Signed-off-by: Zhu Yi <yi.zhu@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi : fix checkpatch.pl errorsAbhijeet Kolekar2008-11-251-1/+1
| | | | | | | | Patch fixes checkpatch.pl errors for iwlwifi. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: run through spell checkerTomas Winkler2008-10-311-1/+1
| | | | | | Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: remove rfkill warning from iwl-ioTomas Winkler2008-09-081-18/+0
| | | | | | | | | The patch removes the warning since registers might be accessed also during rfkill. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlwifi: replace readl and writel with io/read/write/32Tomas Winkler2008-09-081-2/+2
| | | | | | | | | This patch replaces readl and writel with more cross platform ioread32 and iowrite32. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud