diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-08-27 12:53:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-29 16:24:12 -0400 |
commit | ef1a628d83fc0423c36e773281162be790503168 (patch) | |
tree | 436d3d7d91434febb1813dcea16060e6937288b9 /drivers/net/wireless/b43/sysfs.c | |
parent | 35e032d82f3e2a9b0d92077b4fbc97166525ed53 (diff) |
b43: Implement dynamic PHY API
This patch implements a dynamic "ops" based PHY API.
This is needed in order to conveniently support future PHY types
to avoid the "switch"-hell.
This patch does not change any functionality. It just moves lots
of code from one place to another and adjusts it for the changed
data structures.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/sysfs.c')
-rw-r--r-- | drivers/net/wireless/b43/sysfs.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/sysfs.c b/drivers/net/wireless/b43/sysfs.c index 275095b8cbe7..5adaa3692d75 100644 --- a/drivers/net/wireless/b43/sysfs.c +++ b/drivers/net/wireless/b43/sysfs.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "b43.h" | 29 | #include "b43.h" |
30 | #include "sysfs.h" | 30 | #include "sysfs.h" |
31 | #include "main.h" | 31 | #include "main.h" |
32 | #include "phy.h" | 32 | #include "phy_common.h" |
33 | 33 | ||
34 | #define GENERIC_FILESIZE 64 | 34 | #define GENERIC_FILESIZE 64 |
35 | 35 | ||
@@ -59,7 +59,12 @@ static ssize_t b43_attr_interfmode_show(struct device *dev, | |||
59 | 59 | ||
60 | mutex_lock(&wldev->wl->mutex); | 60 | mutex_lock(&wldev->wl->mutex); |
61 | 61 | ||
62 | switch (wldev->phy.interfmode) { | 62 | if (wldev->phy.type != B43_PHYTYPE_G) { |
63 | mutex_unlock(&wldev->wl->mutex); | ||
64 | return -ENOSYS; | ||
65 | } | ||
66 | |||
67 | switch (wldev->phy.g->interfmode) { | ||
63 | case B43_INTERFMODE_NONE: | 68 | case B43_INTERFMODE_NONE: |
64 | count = | 69 | count = |
65 | snprintf(buf, PAGE_SIZE, | 70 | snprintf(buf, PAGE_SIZE, |
@@ -117,11 +122,15 @@ static ssize_t b43_attr_interfmode_store(struct device *dev, | |||
117 | mutex_lock(&wldev->wl->mutex); | 122 | mutex_lock(&wldev->wl->mutex); |
118 | spin_lock_irqsave(&wldev->wl->irq_lock, flags); | 123 | spin_lock_irqsave(&wldev->wl->irq_lock, flags); |
119 | 124 | ||
120 | err = b43_radio_set_interference_mitigation(wldev, mode); | 125 | if (wldev->phy.ops->interf_mitigation) { |
121 | if (err) { | 126 | err = wldev->phy.ops->interf_mitigation(wldev, mode); |
122 | b43err(wldev->wl, "Interference Mitigation not " | 127 | if (err) { |
123 | "supported by device\n"); | 128 | b43err(wldev->wl, "Interference Mitigation not " |
124 | } | 129 | "supported by device\n"); |
130 | } | ||
131 | } else | ||
132 | err = -ENOSYS; | ||
133 | |||
125 | mmiowb(); | 134 | mmiowb(); |
126 | spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); | 135 | spin_unlock_irqrestore(&wldev->wl->irq_lock, flags); |
127 | mutex_unlock(&wldev->wl->mutex); | 136 | mutex_unlock(&wldev->wl->mutex); |