summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/phy_ht.c
Commit message (Collapse)AuthorAgeFilesLines
* b43: HT-PHY: use enum for RSSI typesRafał Miłecki2013-04-231-5/+16
| | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* b43: HT-PHY: store TX power state before disabling itRafał Miłecki2013-04-231-4/+6
| | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* b43: HT-PHY: do some extra TSSI setup after configuring TXRafał Miłecki2013-04-231-0/+13
| | | | | | | | | | After b43_phy_ht_tx_power_ctl_setup there are some extra radio ops: radio_read(0x08bf) -> 0x0001 radio_write(0x08bf) <- 0x0001 radio_write(0x0159) <- 0x0011 On N-PHY we write 0x11 to TSSI regs, so it's probably sth similar. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* b43: HT-PHY: finish calculating values for idle TSSIRafał Miłecki2013-04-231-2/+18
| | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* b43: HT-PHY: tables: don't duplicate core-generic regsRafał Miłecki2013-04-231-21/+14
| | | | | | | Now when we know many radio regs at 0x000 are core-generic, I've noticed we duplicate some values in the tables. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* b43: HT-PHY: rename defines addressing cores on the 2059 radioRafał Miłecki2013-04-231-11/+11
| | | | | | | | | After comparing writes to registers at 0x000, 0x400 and 0x800 it seems there are many very similar writes. So 0x000 offset is not for accessing something totally different, but probably just the first out of three cores. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* Merge branch 'for-john' of ↵John W. Linville2013-04-101-2/+3
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/ath/carl9170/debug.c drivers/net/wireless/ath/carl9170/main.c net/mac80211/ieee80211_i.h
| * mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan2013-03-251-2/+3
| | | | | | | | | | | | | | | | | | | | Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | b43: HT-PHY: enable basic TX power setupRafał Miłecki2013-03-131-9/+0
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: setup TX power controlRafał Miłecki2013-03-131-0/+109
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement RSSI pollingRafał Miłecki2013-03-131-1/+95
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement playing sample toneRafał Miłecki2013-03-131-0/+69
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement stopping sample tone playbackRafał Miłecki2013-03-131-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It was another sequence I recognized in HT-PHY dump: phy_read(0x00c7) -> 0x0001 phy_read(0x00c3) -> 0x0000 phy_write(0x00c3) <- 0x0002 phy_read(0x00c3) -> 0x0000 phy_write(0x00c3) <- 0x0000 The difference to N-PHY is that it writes to 6 tables instead of a one (after above). Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement controlling TX power controlRafał Miłecki2013-03-131-0/+55
| | | | | | | | | | | | | | | | | | Don't enable it until we have (almost?) whole TX power management figured out. It's similar to the N-PHY, the difference is that we call a "fix" *before* disabling power control. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement PA overrideRafał Miłecki2013-03-131-0/+22
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement CCA resetRafał Miłecki2013-03-131-21/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | It was just another similar-to-N-PHY and easy-to-track routine: write32 0xb0601408 <- 0x00002057 phy_read(0x0001) -> 0x0000 phy_write(0x0001) <- 0x4000 phy_write(0x0001) <- 0x0000 write32 0xb0601408 <- 0x00002055 (b43_phy_ht_force_rf_sequence was moved up unmodified) Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement MAC reclockingRafał Miłecki2013-03-131-0/+18
| | | | | | | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: implement spurious tone avoidanceRafał Miłecki2013-03-131-0/+20
| | | | | | | | | | | | | | | | | | On N-PHY it's also done after TX power fix, so it was easy to spot. Unfortunately the MMIO logs I have from ndsiwrapper include channels 1-12 only, so enabling code for 13 and 14 is just a N-PHY-based guess. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: move TX fix to the separated functionRafał Miłecki2013-03-131-18/+28
| | | | | | | | | | | | | | | | | | On N-PHY after B43_PHY_B_TEST operation there is a call to TX power fix function which iterates over available cores. It matches our HT-PHY code which means it's probably also some TX fix. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: add classifier control functionRafał Miłecki2013-03-131-5/+31
| | | | | | | | | | | | | | | | After comparing operations on reg 0xB on N and HT it seems to be the same register with similar ops. Implement them for HT-PHY. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: rename AFE definesRafał Miłecki2013-03-131-19/+19
| | | | | | | | | | | | | | | | | | | | It you take a look at N-PHY analog switch function it touches every core on the chipset. It seems HT-PHY does they same, it just has 3 cores instead of 2 (which make sense since BCM4331 is 3x3). Rename AFE defines to include core id. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | b43: HT-PHY: make it BCMA-onlyRafał Miłecki2013-03-061-0/+5
|/ | | | | | | | | | HT-PHY was found only on BCM4331 which is a BCMA-based chipset. This is reallly unlikely we will ever see HT-PHY on SSB thus make the whole code BCMA specific. This will allow us to call various BCMA-specific functions directly (without extra checks). Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: add my copyrights and myself as the module authorRafał Miłecki2011-09-141-0/+2
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: read clip stateRafał Miłecki2011-08-261-1/+10
| | | | | | | | We don't know yet when to restore it, implement just reading. We found out what for are that PHY ops by comparing HT with N code. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: use separated function for forcing RF sequenceRafał Miłecki2011-08-261-9/+23
| | | | | | | | | Comparison of the HT and N code has shown similarities in the ops performed after b43_mac_phy_clock_set. That way we understood what is happening in the HT-PHY code. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: add missing small-tables writesRafał Miłecki2011-08-221-3/+30
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: add some AFE (Analog Frontend) operationRafał Miłecki2011-08-221-0/+26
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: add missing PHY mask/set opsRafał Miłecki2011-08-221-5/+41
| | | | | | | | | | | | | MMIO hacks were used to trick ndis&wl. For example following: phy_read(0x0280) -> 0xffff phy_write(0x0280) <- 0xff3e *** phy_read(0x0280) -> 0x0000 phy_write(0x0280) <- 0x003e was translated to mask 0xff00 and set 0x3e. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: init BPHY and upload 0x1a tableRafał Miłecki2011-08-221-0/+26
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: copy tables and reset CCARafał Miłecki2011-08-221-0/+21
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: implement few simple PHY writesRafał Miłecki2011-08-221-0/+22
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init: zero EXTG registersRafał Miłecki2011-08-221-0/+22
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: fix masks in radio ctlRafał Miłecki2011-07-191-5/+10
| | | | | | | Old masks were causing ugly, delayed lock ups. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: fix typo in 0x2059 radio initRafał Miłecki2011-07-191-1/+1
| | | | | | | | | Following operation was incorrectly translated: radio_read(0x0011) -> 0xffff radio_write(0x0011) <- 0xfff7 Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: switch to channel after enabling radioRafał Miłecki2011-07-191-1/+3
| | | | | | | | Also change the default channel to 11. This is the first channel closed driver switches to. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: define dummy TX power functionsRafał Miłecki2011-07-081-2/+10
| | | | | | | Without them we get Oops with NULL pointer Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: correct 0x2059 radio initRafał Miłecki2011-06-291-1/+49
| | | | | | | | Sometimes additional steps are performed while initializing 2059 radio. We did not find the condition yet, so make it always true for now. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: basic PHY initRafał Miłecki2011-06-291-2/+7
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: init radio when enabling itRafał Miłecki2011-06-291-0/+33
| | | | | | | | | | | | | | | | | Masks and sets were found in MMIO dumps by using MMIO hacks. Shortly: radio_write(0x0c51) <- 0x0070 radio_write(0x0c5a) <- 0x0003 radio_write(0x0146) <- 0x0003 radio_write(0x0546) <- 0x0003 radio_write(0x0946) <- 0x0003 radio_write(0x002e) <- 0x0078 radio_write(0x00c0) <- 0x0080 radio_write(0x002e) <- 0xff87 radio_write(0x00c0) <- 0xff7f radio_write(0x0011) <- 0xfff7 Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: replace radio routing magic numbersRafał Miłecki2011-06-291-1/+1
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: implement lacking 0x908 PHY reg opRafał Miłecki2011-06-291-1/+6
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: perform some tables ops on channel switchingRafał Miłecki2011-06-291-0/+19
| | | | | | | | Starring at MMIO dumps around PHY channel switching has led to finding serie of 3 similar ops this patch implements. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: upload PHY values when switching channelRafał Miłecki2011-06-291-1/+15
| | | | | | | | | | | | | | | | After calibrating radio you can find few PHY writes in MMIO dumps: phy_read(0x0009) -> 0x0000 phy_write(0x01ce) <- 0x03dd phy_write(0x01cf) <- 0x03d9 phy_write(0x01d0) <- 0x03d5 phy_write(0x01d1) <- 0x0424 phy_write(0x01d2) <- 0x0429 phy_write(0x01d3) <- 0x042d By comparing to N-PHY code we found out that they are PHY tables for channel switching plus band info read at the beginning. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: calibrate radio after switching channelRafał Miłecki2011-06-221-1/+7
| | | | | | | | | | | | | | | | After uploading radio values calibration goes in. In MMIO dump it is: radio_read(0x002b) -> 0x0008 radio_write(0x002b) <- 0x0008 radio_read(0x002e) -> 0x0004 radio_write(0x002e) <- 0x0000 radio_read(0x002e) -> 0x0000 radio_write(0x002e) <- 0x0004 radio_read(0x002b) -> 0x0008 radio_write(0x002b) <- 0x0009 To find masks and sets, MMIO hacks were used to fool closed driver. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: switch radio to requested channelRafał Miłecki2011-06-221-0/+39
| | | | | | | | | Switching channel happens after specific SHM write to B43_SHM_SH_CHAN. This is the way we found it in BCM4331 MMIO dumps. By comparing with N-PHY code we noticed there is routing used for SYN and TX/RX. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: add place for implementing channel switchingRafał Miłecki2011-06-221-2/+59
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: define standard structs for channel switchingRafał Miłecki2011-06-221-0/+1
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: enable radioRafał Miłecki2011-06-221-0/+4
| | | | | | | | The trick was to find 0x810 PHY reg ops close to analog enabling code. To find out proper masks and sets, MMIO hacks were used. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: implement killing radioRafał Miłecki2011-06-221-2/+13
| | | | | | | | | | | | | Closed drivers kill radio right after reading radio version and MACCTL, so it was easy to find related PHY ops: phy_read(0x0810) -> 0x0000 phy_write(0x0810) <- 0x0000 To find out the mask of above OP, MMIO hack was used to fake read val: phy_read(0x0810) -> 0xffff phy_write(0x0810) <- 0x0000 Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* b43: HT-PHY: implement switching analogRafał Miłecki2011-06-171-0/+21
| | | | | | | | | Turning it on is always done between reading PHY version and radio version, so it was easy to find it in MMIO dumps from ndiswrapper. Turning off is done by writing different values to the same registers. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>