diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-11-28 04:39:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 14:37:00 -0500 |
commit | 172c69a47675dc1ca9c7243c031d8d77701bccc0 (patch) | |
tree | 1f898bd1df40748483faab6284d50d343cdb8be5 /drivers/ssb | |
parent | 61790c5f3c5f158821821a00797d94504531839f (diff) |
ssb: extract indexes for power tables
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/pci.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c index f52966305e05..158449e55044 100644 --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c | |||
@@ -406,6 +406,46 @@ static void sprom_extract_r123(struct ssb_sprom *out, const u16 *in) | |||
406 | out->antenna_gain.ghz5.a3 = gain; | 406 | out->antenna_gain.ghz5.a3 = gain; |
407 | } | 407 | } |
408 | 408 | ||
409 | /* Revs 4 5 and 8 have partially shared layout */ | ||
410 | static void sprom_extract_r458(struct ssb_sprom *out, const u16 *in) | ||
411 | { | ||
412 | SPEX(txpid2g[0], SSB_SPROM4_TXPID2G01, | ||
413 | SSB_SPROM4_TXPID2G0, SSB_SPROM4_TXPID2G0_SHIFT); | ||
414 | SPEX(txpid2g[1], SSB_SPROM4_TXPID2G01, | ||
415 | SSB_SPROM4_TXPID2G1, SSB_SPROM4_TXPID2G1_SHIFT); | ||
416 | SPEX(txpid2g[2], SSB_SPROM4_TXPID2G23, | ||
417 | SSB_SPROM4_TXPID2G2, SSB_SPROM4_TXPID2G2_SHIFT); | ||
418 | SPEX(txpid2g[3], SSB_SPROM4_TXPID2G23, | ||
419 | SSB_SPROM4_TXPID2G3, SSB_SPROM4_TXPID2G3_SHIFT); | ||
420 | |||
421 | SPEX(txpid5gl[0], SSB_SPROM4_TXPID5GL01, | ||
422 | SSB_SPROM4_TXPID5GL0, SSB_SPROM4_TXPID5GL0_SHIFT); | ||
423 | SPEX(txpid5gl[1], SSB_SPROM4_TXPID5GL01, | ||
424 | SSB_SPROM4_TXPID5GL1, SSB_SPROM4_TXPID5GL1_SHIFT); | ||
425 | SPEX(txpid5gl[2], SSB_SPROM4_TXPID5GL23, | ||
426 | SSB_SPROM4_TXPID5GL2, SSB_SPROM4_TXPID5GL2_SHIFT); | ||
427 | SPEX(txpid5gl[3], SSB_SPROM4_TXPID5GL23, | ||
428 | SSB_SPROM4_TXPID5GL3, SSB_SPROM4_TXPID5GL3_SHIFT); | ||
429 | |||
430 | SPEX(txpid5g[0], SSB_SPROM4_TXPID5G01, | ||
431 | SSB_SPROM4_TXPID5G0, SSB_SPROM4_TXPID5G0_SHIFT); | ||
432 | SPEX(txpid5g[1], SSB_SPROM4_TXPID5G01, | ||
433 | SSB_SPROM4_TXPID5G1, SSB_SPROM4_TXPID5G1_SHIFT); | ||
434 | SPEX(txpid5g[2], SSB_SPROM4_TXPID5G23, | ||
435 | SSB_SPROM4_TXPID5G2, SSB_SPROM4_TXPID5G2_SHIFT); | ||
436 | SPEX(txpid5g[3], SSB_SPROM4_TXPID5G23, | ||
437 | SSB_SPROM4_TXPID5G3, SSB_SPROM4_TXPID5G3_SHIFT); | ||
438 | |||
439 | SPEX(txpid5gh[0], SSB_SPROM4_TXPID5GH01, | ||
440 | SSB_SPROM4_TXPID5GH0, SSB_SPROM4_TXPID5GH0_SHIFT); | ||
441 | SPEX(txpid5gh[1], SSB_SPROM4_TXPID5GH01, | ||
442 | SSB_SPROM4_TXPID5GH1, SSB_SPROM4_TXPID5GH1_SHIFT); | ||
443 | SPEX(txpid5gh[2], SSB_SPROM4_TXPID5GH23, | ||
444 | SSB_SPROM4_TXPID5GH2, SSB_SPROM4_TXPID5GH2_SHIFT); | ||
445 | SPEX(txpid5gh[3], SSB_SPROM4_TXPID5GH23, | ||
446 | SSB_SPROM4_TXPID5GH3, SSB_SPROM4_TXPID5GH3_SHIFT); | ||
447 | } | ||
448 | |||
409 | static void sprom_extract_r45(struct ssb_sprom *out, const u16 *in) | 449 | static void sprom_extract_r45(struct ssb_sprom *out, const u16 *in) |
410 | { | 450 | { |
411 | int i; | 451 | int i; |
@@ -471,6 +511,8 @@ static void sprom_extract_r45(struct ssb_sprom *out, const u16 *in) | |||
471 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, | 511 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, |
472 | sizeof(out->antenna_gain.ghz5)); | 512 | sizeof(out->antenna_gain.ghz5)); |
473 | 513 | ||
514 | sprom_extract_r458(out, in); | ||
515 | |||
474 | /* TODO - get remaining rev 4 stuff needed */ | 516 | /* TODO - get remaining rev 4 stuff needed */ |
475 | } | 517 | } |
476 | 518 | ||
@@ -561,6 +603,8 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in) | |||
561 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, | 603 | memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24, |
562 | sizeof(out->antenna_gain.ghz5)); | 604 | sizeof(out->antenna_gain.ghz5)); |
563 | 605 | ||
606 | sprom_extract_r458(out, in); | ||
607 | |||
564 | /* TODO - get remaining rev 8 stuff needed */ | 608 | /* TODO - get remaining rev 8 stuff needed */ |
565 | } | 609 | } |
566 | 610 | ||