aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-io.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-03-09iwlwifi: pcie: enable LP XTAL to reduce power consumptionAlexander Bondar1-2/+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>
2014-02-03iwlwifi: pcie: fix secure section / dual cpu firmware loadingEran Harary1-0/+15
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>
2013-12-31iwlwifi: Update Copyright to 2014Emmanuel Grumbach1-1/+1
Happy new year! Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-10-29iwlwifi: remove duplicate includesMichael Opdenacker1-1/+0
Reported by "make includecheck" Tested that the corresponding sources still compile well on x86 Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2013-07-16iwlwifi: move dump_fh into common codeInbal Hacohen1-0/+67
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>
2013-03-06iwlwifi: export symbols only conditionallyJohannes Berg1-9/+10
If all the pieces of iwlwifi are built into the kernel then there's no need for it to export its symbols to other modules, so prevent that. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-01iwlwifi: move register access lock into transportLilach Edelstein1-29/+14
Move the reg_lock that protects HW register access into the transport implementation. Locking is no longer exposed, but handled internally in grab and release NIC access. This simplifies the users. 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>
2013-02-01iwlwifi: add iwl_set_bits_mask to transport APILilach Edelstein1-48/+0
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>
2013-01-24iwlwifi: update copyrightJohannes Berg1-1/+1
Update Copyright notices to 2013. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03iwlwifi: always check that grab_nic_access succeedsEmmanuel Grumbach1-13/+15
This allows to let sparse check that the NIC access is always released. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03iwlwifi: virtualize SRAM accessEmmanuel Grumbach1-56/+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>
2013-01-03iwlwifi: virtualize iwl_{grab,release}_nic_accessEmmanuel Grumbach1-92/+22
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>
2012-12-06iwlwifi: move prph handling into the transportEmmanuel Grumbach1-20/+20
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>
2012-10-16iwlwifi: wipe out the status of the SCD when we disable a queueEmmanuel Grumbach1-2/+2
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>
2012-07-24Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-1/+1
Pull trivial tree from Jiri Kosina: "Trivial updates all over the place as usual." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (29 commits) Fix typo in include/linux/clk.h . pci: hotplug: Fix typo in pci iommu: Fix typo in iommu video: Fix typo in drivers/video Documentation: Add newline at end-of-file to files lacking one arm,unicore32: Remove obsolete "select MISC_DEVICES" module.c: spelling s/postition/position/g cpufreq: Fix typo in cpufreq driver trivial: typo in comment in mksysmap mach-omap2: Fix typo in debug message and comment scsi: aha152x: Fix sparse warning and make printing pointer address more portable. Change email address for Steve Glendinning Btrfs: fix typo in convert_extent_bit via: Remove bogus if check netprio_cgroup.c: fix comment typo backlight: fix memory leak on obscure error path Documentation: asus-laptop.txt references an obsolete Kconfig item Documentation: ManagementStyle: fixed typo mm/vmscan: cleanup comment error in balance_pgdat mm: cleanup on the comments of zone_reclaim_stat ...
2012-06-28treewide: Put a space between #include and FILEPaul Bolle1-1/+1
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-06-13iwlwifi: iwl_{read,write}_targ_mem_words takes dwordsEmmanuel Grumbach1-10/+10
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>
2012-06-06iwlwifi: add iwl_set_bits_maskJohannes Berg1-0/+18
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>
2012-06-05iwlwifi: implement dynamic opmode loadingDon Fry1-0/+19
This is the next step in splitting up the driver, making the uCode API dependent pieces of it live in separate modules. Right now there's only one so it's not user-selectable, but we're actively working on more. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08iwlwifi: cleanup/fix memory barriersStanislaw Gruszka1-5/+7
wmb(), rmb() are not needed when writel(), readl() are used as accessors for MMIO. We use them indirectly via iowrite32(), ioread32(). What is needed mmiowb(), for synchronizing writes coming from different CPUs on PCIe bridge (see in patch comments). This fortunately is not needed on x86, where mmiowb() is just defined as compiler barrier. As iwlwifi devices are most likely not used on anything other than x86, this is not so important fix. 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>
2012-03-08iwlwifi: always check if got h/w access before writeStanislaw Gruszka1-25/+28
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>
2012-03-08iwlwifi: dump stack when fail to gain access to the deviceStanislaw Gruszka1-3/+3
Print dump stack when the device is not responding. This should give some more clue about the reason of failure. Also change the message we print, since "MAC in deep sleep" is kinda confusing. On the way add unlikely(), as fail to gain NIC access is hmm ... unlikely. 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>
2012-02-02iwlwifi: give trans to all the read / write functionsEmmanuel Grumbach1-96/+97
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>
2012-01-06iwlwifi: update CopyrightWey-Yi Guy1-1/+1
Update Copyright to 2012 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16iwlwifi: add IO function for continuous write of target memoryHsu, Kenny1-3/+16
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>
2011-11-21iwlwifi: remove redundancyWey-Yi Guy1-1/+1
just use iwl_bus, remove the redundancy Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-29iwlagn: all function iwl-io.c receive iwl_busEmmanuel Grumbach1-94/+98
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>
2011-04-30iwlagn: introduce silent grabbing of NIC accessJohannes Berg1-5/+13
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>
2011-04-22iwlagn: simplify error table readingJohannes Berg1-3/+15
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>
2011-04-07iwlagn: move IO functions out of lineJohannes Berg1-0/+274
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>