Commit Graph

30 Commits

Author SHA1 Message Date
Rafał Miłecki 108f4f3c4a b43: add my copyrights and myself as the module author
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14 13:56:25 -04:00
Rafał Miłecki ea5a08cfa5 b43: HT-PHY: read clip state
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>
2011-08-26 10:47:57 -04:00
Rafał Miłecki c750f795c7 b43: HT-PHY: use separated function for forcing RF sequence
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>
2011-08-26 10:47:57 -04:00
Rafał Miłecki 98f8dc72ac b43: HT-PHY: init: add missing small-tables writes
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:02 -04:00
Rafał Miłecki a4042bb093 b43: HT-PHY: init: add some AFE (Analog Frontend) operation
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 357e24d2d0 b43: HT-PHY: init: add missing PHY mask/set ops
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>
2011-08-22 14:46:01 -04:00
Rafał Miłecki b50583484a b43: HT-PHY: init: init BPHY and upload 0x1a table
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 19240f36cf b43: HT-PHY: init: copy tables and reset CCA
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki f457f1842d b43: HT-PHY: init: implement few simple PHY writes
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 15222b582d b43: HT-PHY: init: zero EXTG registers
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Rafał Miłecki 0b5dd734d3 b43: HT-PHY: fix masks in radio ctl
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>
2011-07-19 16:49:57 -04:00
Rafał Miłecki b473bc1767 b43: HT-PHY: fix typo in 0x2059 radio init
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>
2011-07-19 16:49:52 -04:00
Rafał Miłecki 315a685f26 b43: HT-PHY: switch to channel after enabling radio
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>
2011-07-19 16:49:50 -04:00
Rafał Miłecki 21a18f284b b43: HT-PHY: define dummy TX power functions
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>
2011-07-08 11:42:25 -04:00
Rafał Miłecki a5f377fb9c b43: HT-PHY: correct 0x2059 radio init
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>
2011-06-29 15:11:06 -04:00
Rafał Miłecki 2d02c86b77 b43: HT-PHY: basic PHY init
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-29 15:11:03 -04:00
Rafał Miłecki 3e644ab47e b43: HT-PHY: init radio when enabling it
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>
2011-06-29 15:11:02 -04:00
Rafał Miłecki e8dec1e99a b43: HT-PHY: replace radio routing magic numbers
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-29 15:11:01 -04:00
Rafał Miłecki bfc8dfec45 b43: HT-PHY: implement lacking 0x908 PHY reg op
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-29 14:53:25 -04:00
Rafał Miłecki e5b61007bc b43: HT-PHY: perform some tables ops on channel switching
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>
2011-06-29 14:53:24 -04:00
Rafał Miłecki bdb2dfb237 b43: HT-PHY: upload PHY values when switching channel
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>
2011-06-29 14:53:23 -04:00
Rafał Miłecki c1c3daee97 b43: HT-PHY: calibrate radio after switching channel
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>
2011-06-22 16:09:44 -04:00
Rafał Miłecki a6b7da5d2c b43: HT-PHY: switch radio to requested channel
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>
2011-06-22 16:09:43 -04:00
Rafał Miłecki 39ca554c96 b43: HT-PHY: add place for implementing channel switching
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-22 16:09:42 -04:00
Rafał Miłecki 5192bf56b9 b43: HT-PHY: define standard structs for channel switching
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-22 16:09:42 -04:00
Rafał Miłecki 1a3f71ae66 b43: HT-PHY: enable radio
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>
2011-06-22 16:09:42 -04:00
Rafał Miłecki e7c62552ec b43: HT-PHY: implement killing radio
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>
2011-06-22 16:09:41 -04:00
Rafał Miłecki a8e827495a b43: HT-PHY: implement switching analog
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>
2011-06-17 14:22:28 -04:00
Rafał Miłecki 4cabd4254b b43: HT-PHY: implement radio ops
Every PHY has some specific bit used for reading radio regs. Analyze of
MMIO dumps from BCM4331 and ndiswrapper has shown it is 0x200 for HT.
 radio_read(0x037f) -> 0x0073
radio_write(0x017f) <- 0x0072

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-17 14:22:27 -04:00
Rafał Miłecki d7520b1d2a b43: HT-PHY: add place for writing HT PHY support
This is totally broken plus we do not have specs for HT PHY yet. Just
introduce place for writing driver if we discover anything.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-17 14:22:20 -04:00