summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/nvm.c
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: mvm: warn about empty OTPEran Harary2014-07-071-0/+2
| | | | | Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: assure no overflows occur while reading otpLiad Kaufman2014-06-241-2/+12
| | | | | | | | | Just in case sizes change in the OTP without proper SW updating, an additional check is inserted when reading OTP sections to assure no overflows occur. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: nvm: update maximal parsed values in external nvmLiad Kaufman2014-06-241-2/+13
| | | | | | | | | Some of the maximum values of the parsed external NVM file in the B-step of the 8000 HW family were updated, so this updates these values. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: revisit the NVM handling codeEran Harary2014-05-131-32/+32
| | | | | | | | | | | | | | | | | | | | | Fix a bug in nvm_read_section function if size of the section is a multiple of 2K: - if the size of the section is *not* multiple of 2K, then we will have: read(2K) - return 2K ... read(2K) - return 2K read(2K) - return the rest (in bytes) and exit the while loop. - else, if the size of the section is a multiple of 2K, then we have: read(2K) - return 2K read(2K) - return 2K read(2K) - return 2K read(2K) - return 0 and exit the while with an error. We should not return an error in the latter case, because it might well be that the section was completely read. Also, we try now to read all the sections as this is needed for new devices. Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: remove CMD_SYNCEmmanuel Grumbach2014-05-131-2/+2
| | | | | | | | | CMD_SYNC is really 0 which is confusing: if (cmd.flags & CMD_SYNC) is always false. Fix this by simply removing its definition. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: 8000: add default NVM file name in family 8000Eran Harary2014-05-111-4/+4
| | | | | | | | | | The 8000 family products need a file on the file system which is used as NVM. This file is a must, if no filename is supplied as module parameter, use a default filename. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix bug in parse_nvm_sectionsEran Harary2014-05-061-1/+1
| | | | | | | | | | The old code checks if hw_section_num is valid while the right thing to do is to check if section[hw_section_num].data is valid. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: select the MAC address according to priorityEran Harary2014-05-061-1/+8
| | | | | | | | | | For family 8000 products, the driver should take the MAC address from the mac_override section and only if this section is empty it should take it from the HW section. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: Prioritize external nvm values on top of the OTP valuesEran Harary2014-05-061-8/+10
| | | | | | | | | | | Read first the nvm sections from the OTP, then read the nvm sections from the external file and override the OTP values (if there were any values in the OTP). Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: prevent nic to powered up at driver loadEran Harary2014-05-061-2/+4
| | | | | | | | | | | A few devices aren't allowed to be powered up at driver load time. Add "power_up_nic_in_init" flag to iwl_cfg structure to customize the load flow according to the device. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix bug with OTP memory sizeEran Harary2014-05-061-1/+0
| | | | | | | | OTP size changed in family 7000 and in family 8000. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: remove iwl_fw_valid_(tx|rx)_ant inlinesJohannes Berg2014-02-131-2/+2
| | | | | | | | | These inlines are pretty pointless now as they just return a fixed struct value, remove them - the code even gets shorter. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: new NVM format in family 8000Eran Harary2014-02-131-14/+49
| | | | | | | | | | | Support the changes below: - Fields and sections structure were changed. - the NVM file built from DWord instead of Words. - sections header format was changed. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: support NVM sections for family 8000Eran Harary2014-02-031-15/+19
| | | | | | | | | | | The identification of the hardware section in the NVM of new devices has been changed, hence the need to add it to iwl_cfg and adapt the code that uses this value accordingly. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix theoretical uninitialized function return valueEytan Lifshitz2014-01-131-1/+1
| | | | | | | | | If we try to write NVM that do not exist, the function will return uninitialized value. fixed. Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: send all the NVM sections to the NICEmmanuel Grumbach2014-01-131-6/+5
| | | | | | | | | | | | Some NIC comes with more than the 4 NVM (non volative memory) sections described in the nvm_to_read array. These NICs usually get their NVM from an external file fetched from userland during init. We already parsed the file, but sent to the NIC only 4 NVM sections whereas there could be more sections in the file. Fix this. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: Update Copyright to 2014Emmanuel Grumbach2013-12-311-2/+2
| | | | | | Happy new year! Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix possible memory leakEytan Lifshitz2013-12-311-5/+6
| | | | | | | | | In case of invalid section_id, the function returns after it aleready allocated memory. Fixed by change the order of actions. Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: dump NVM from debugfsEmmanuel Grumbach2013-12-091-0/+23
| | | | | | | | This allows to see the content of the NVM the driver reads. Note that the output is in binary, and requires some external user space tool to display the data properly. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: NVM - increase max section sizeIdan Kahlon2013-10-181-1/+1
| | | | | | | | | | | Section size limitation to 6000 is incorrect. NVM file need to support bigger sections in order to support PAPD tables. Signed-off-by: Idan Kahlon <idanx.kahlon@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Maor Perez <maorx.perez@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: prevent the NIC to be powered at driver load time.Eytan Lifshitz2013-10-111-33/+66
| | | | | | | | | Some NICs aren't allowed to be powered up at driver load time. Fix it, and move the external NVM loading from driver load time to driver up time (parsing the external nvm file remains at driver load time). Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: take valid ant for HT caps from TLVEmmanuel Grumbach2013-05-291-1/+3
| | | | | | | | | I forgot to take them from TLV and took them from the NVM instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: fix initialisation while RF-kill is assertedEran Harary2013-05-161-2/+2
| | | | | | | | | | | | | If RF-kill is asserted while a device is initialized, the firmware INIT image can now be run to retrieve the NVM data and register to mac80211 properly. Previously, the initialisation would fail in this scenario and the driver wouldn't register with mac80211 at all, making the device unusable. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: support loading NVM data from fileEran Harary2013-05-161-8/+190
| | | | | | | | | | | Some newer devices will be integrated into the platform more deeply and will not have embedded NVM (EEPROM/OTP). To support such devices the NVM data must be provided by the platform, allow loading the data via request_firmware() and then send it to the device as needed. Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: nvm: don't print NVM section reads by defaultJohannes Berg2013-05-161-1/+2
| | | | | | | | These messages aren't really useful, suppress them unless EEPROM debugging is turned on. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: fix NVM parsing error pathJohannes Berg2013-05-161-2/+3
| | | | | | | | | | If NVM parsing fails and returns NULL, we continue in the code flow and eventually crash accessing the NULL pointer. Return an error from iwl_nvm_init() if the parsing failed. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: MVM op_mode is supported on 7000 onlyEmmanuel Grumbach2013-03-201-106/+30
| | | | | | | | | The code removed in this patch was used for bring up on older NICs. No MVM capable fw will ever be released for older NICs, so remove that code. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: Change NVM default section read sizeDor Shaish2013-03-061-3/+6
| | | | | | Signed-off-by: Dor Shaish <dor.shaish@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: a few fixes in licenseEmmanuel Grumbach2013-03-061-1/+1
| | | | | | | | | | 7000.c was released as GPL only by mistake: it should be dual licensed - GPL / BSD. The file that contains the license in the kernel is COPYING and not LICENSE.GPL. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: add the MVM driverJohannes Berg2013-02-011-0/+311
Newer firmware revisions have a completely new firmware API. This is the new driver for this new API. I've listed the people who directly contributed code, but many others from various teams have contributed in other ways. Cc: Alexander Bondar <alexander.bondar@intel.com> Cc: Amit Beka <amit.beka@intel.com> Cc: Amnon Paz <amnonx.paz@intel.com> Cc: Assaf Krauss <assaf.krauss@intel.com> Cc: David Spinadel <david.spinadel@intel.com> Cc: Dor Shaish <dor.shaish@intel.com> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Cc: Eytan Lifshitz <eytan.lifshitz@intel.com> Cc: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
OpenPOWER on IntegriCloud