aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Brivio <stefano.brivio@polimi.it>2008-02-08 00:31:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:06 -0500
commiteed0fd2102206bf6108460274c40ee6b8e863369 (patch)
treea3c1da60c7ba3a40512535cd7a49d44cadfb1ba3
parent292ae1745b8fe25b8182655d4bd5628e7947ea6b (diff)
b43legacy: add definitions for MAC control register
This adds some definitions for the MAC control register and uses them. This is basically no functional change. The patch by Michael Buesch has been ported to b43legacy. Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43legacy/b43legacy.h9
-rw-r--r--drivers/net/wireless/b43legacy/main.c29
2 files changed, 22 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index 5f217d6d2e6..ba08574a247 100644
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -199,6 +199,13 @@
199#define B43legacy_MACCTL_TBTTHOLD 0x10000000 /* TBTT Hold */ 199#define B43legacy_MACCTL_TBTTHOLD 0x10000000 /* TBTT Hold */
200#define B43legacy_MACCTL_GMODE 0x80000000 /* G Mode */ 200#define B43legacy_MACCTL_GMODE 0x80000000 /* G Mode */
201 201
202/* MAC Command bitfield */
203#define B43legacy_MACCMD_BEACON0_VALID 0x00000001 /* Beacon 0 in template RAM is busy/valid */
204#define B43legacy_MACCMD_BEACON1_VALID 0x00000002 /* Beacon 1 in template RAM is busy/valid */
205#define B43legacy_MACCMD_DFQ_VALID 0x00000004 /* Directed frame queue valid (IBSS PS mode, ATIM) */
206#define B43legacy_MACCMD_CCA 0x00000008 /* Clear channel assessment */
207#define B43legacy_MACCMD_BGNOISE 0x00000010 /* Background noise */
208
202/* 802.11 core specific TM State Low flags */ 209/* 802.11 core specific TM State Low flags */
203#define B43legacy_TMSLOW_GMODE 0x20000000 /* G Mode Enable */ 210#define B43legacy_TMSLOW_GMODE 0x20000000 /* G Mode Enable */
204#define B43legacy_TMSLOW_PLLREFSEL 0x00200000 /* PLL Freq Ref Select */ 211#define B43legacy_TMSLOW_PLLREFSEL 0x00200000 /* PLL Freq Ref Select */
@@ -645,7 +652,7 @@ struct b43legacy_wldev {
645 652
646 bool __using_pio; /* Using pio rather than dma. */ 653 bool __using_pio; /* Using pio rather than dma. */
647 bool bad_frames_preempt;/* Use "Bad Frames Preemption". */ 654 bool bad_frames_preempt;/* Use "Bad Frames Preemption". */
648 bool reg124_set_0x4; /* Variable to keep track of IRQ. */ 655 bool dfq_valid; /* Directed frame queue valid (IBSS PS mode, ATIM). */
649 bool short_preamble; /* TRUE if using short preamble. */ 656 bool short_preamble; /* TRUE if using short preamble. */
650 bool short_slot; /* TRUE if using short slot timing. */ 657 bool short_slot; /* TRUE if using short slot timing. */
651 bool radio_hw_enable; /* State of radio hardware enable bit. */ 658 bool radio_hw_enable; /* State of radio hardware enable bit. */
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index d2a72a2cd17..9db949ed651 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -805,9 +805,8 @@ static void b43legacy_generate_noise_sample(struct b43legacy_wldev *dev)
805{ 805{
806 b43legacy_jssi_write(dev, 0x7F7F7F7F); 806 b43legacy_jssi_write(dev, 0x7F7F7F7F);
807 b43legacy_write32(dev, B43legacy_MMIO_MACCMD, 807 b43legacy_write32(dev, B43legacy_MMIO_MACCMD,
808 b43legacy_read32(dev, 808 b43legacy_read32(dev, B43legacy_MMIO_MACCMD)
809 B43legacy_MMIO_MACCMD) 809 | B43legacy_MACCMD_BGNOISE);
810 | (1 << 4));
811 B43legacy_WARN_ON(dev->noisecalc.channel_at_start != 810 B43legacy_WARN_ON(dev->noisecalc.channel_at_start !=
812 dev->phy.channel); 811 dev->phy.channel);
813} 812}
@@ -896,18 +895,18 @@ static void handle_irq_tbtt_indication(struct b43legacy_wldev *dev)
896 if (1/*FIXME: the last PSpoll frame was sent successfully */) 895 if (1/*FIXME: the last PSpoll frame was sent successfully */)
897 b43legacy_power_saving_ctl_bits(dev, -1, -1); 896 b43legacy_power_saving_ctl_bits(dev, -1, -1);
898 } 897 }
899 dev->reg124_set_0x4 = 0;
900 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) 898 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS))
901 dev->reg124_set_0x4 = 1; 899 dev->dfq_valid = 1;
902} 900}
903 901
904static void handle_irq_atim_end(struct b43legacy_wldev *dev) 902static void handle_irq_atim_end(struct b43legacy_wldev *dev)
905{ 903{
906 if (!dev->reg124_set_0x4) /*FIXME rename this variable*/ 904 if (dev->dfq_valid) {
907 return; 905 b43legacy_write32(dev, B43legacy_MMIO_MACCMD,
908 b43legacy_write32(dev, B43legacy_MMIO_MACCMD, 906 b43legacy_read32(dev, B43legacy_MMIO_MACCMD)
909 b43legacy_read32(dev, B43legacy_MMIO_MACCMD) 907 | B43legacy_MACCMD_DFQ_VALID);
910 | 0x4); 908 dev->dfq_valid = 0;
909 }
911} 910}
912 911
913static void handle_irq_pmq(struct b43legacy_wldev *dev) 912static void handle_irq_pmq(struct b43legacy_wldev *dev)
@@ -1107,7 +1106,7 @@ static int b43legacy_refresh_cached_beacon(struct b43legacy_wldev *dev,
1107 1106
1108static void b43legacy_update_templates(struct b43legacy_wldev *dev) 1107static void b43legacy_update_templates(struct b43legacy_wldev *dev)
1109{ 1108{
1110 u32 status; 1109 u32 cmd;
1111 1110
1112 B43legacy_WARN_ON(!dev->cached_beacon); 1111 B43legacy_WARN_ON(!dev->cached_beacon);
1113 1112
@@ -1118,9 +1117,9 @@ static void b43legacy_update_templates(struct b43legacy_wldev *dev)
1118 b43legacy_write_probe_resp_template(dev, 0x268, 0x4A, 1117 b43legacy_write_probe_resp_template(dev, 0x268, 0x4A,
1119 &b43legacy_b_ratetable[0]); 1118 &b43legacy_b_ratetable[0]);
1120 1119
1121 status = b43legacy_read32(dev, B43legacy_MMIO_MACCMD); 1120 cmd = b43legacy_read32(dev, B43legacy_MMIO_MACCMD);
1122 status |= 0x03; 1121 cmd |= B43legacy_MACCMD_BEACON0_VALID | B43legacy_MACCMD_BEACON1_VALID;
1123 b43legacy_write32(dev, B43legacy_MMIO_MACCMD, status); 1122 b43legacy_write32(dev, B43legacy_MMIO_MACCMD, cmd);
1124} 1123}
1125 1124
1126static void b43legacy_refresh_templates(struct b43legacy_wldev *dev, 1125static void b43legacy_refresh_templates(struct b43legacy_wldev *dev,
@@ -2928,7 +2927,7 @@ static void setup_struct_phy_for_init(struct b43legacy_wldev *dev,
2928static void setup_struct_wldev_for_init(struct b43legacy_wldev *dev) 2927static void setup_struct_wldev_for_init(struct b43legacy_wldev *dev)
2929{ 2928{
2930 /* Flags */ 2929 /* Flags */
2931 dev->reg124_set_0x4 = 0; 2930 dev->dfq_valid = 0;
2932 2931
2933 /* Stats */ 2932 /* Stats */
2934 memset(&dev->stats, 0, sizeof(dev->stats)); 2933 memset(&dev->stats, 0, sizeof(dev->stats));