diff options
author | Ulrich Kunitz <kune@deine-taler.de> | 2007-10-02 13:36:53 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:09 -0400 |
commit | 937a049dd903bd810d858d0303cf86af9eb08b6f (patch) | |
tree | 22043f905ea2ab4002c1a51044e471880d11714c /drivers/net/wireless/zd1211rw | |
parent | 09703f5e79a64c744721b9c27502075232ba0ea2 (diff) |
[ZD1211RW]: Removed zd_util.c and zd_util.h
The kernel now provides a generic hexdump implementation should we need
it again, so we can remove it from zd1211rw. After removing that, only
one single-user function is left in zd_util. Move that to zd_mac and
remove zd_util.
Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_chip.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_util.c | 82 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_util.h | 29 |
6 files changed, 3 insertions, 116 deletions
diff --git a/drivers/net/wireless/zd1211rw/Makefile b/drivers/net/wireless/zd1211rw/Makefile index 4d505903352c..7a2f2a98edab 100644 --- a/drivers/net/wireless/zd1211rw/Makefile +++ b/drivers/net/wireless/zd1211rw/Makefile | |||
@@ -4,7 +4,7 @@ zd1211rw-objs := zd_chip.o zd_ieee80211.o \ | |||
4 | zd_mac.o zd_netdev.o \ | 4 | zd_mac.o zd_netdev.o \ |
5 | zd_rf_al2230.o zd_rf_rf2959.o \ | 5 | zd_rf_al2230.o zd_rf_rf2959.o \ |
6 | zd_rf_al7230b.o zd_rf_uw2453.o \ | 6 | zd_rf_al7230b.o zd_rf_uw2453.o \ |
7 | zd_rf.o zd_usb.o zd_util.o | 7 | zd_rf.o zd_usb.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_ZD1211RW_DEBUG),y) | 9 | ifeq ($(CONFIG_ZD1211RW_DEBUG),y) |
10 | EXTRA_CFLAGS += -DDEBUG | 10 | EXTRA_CFLAGS += -DDEBUG |
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 3d60c69b20e7..f831b68f1b9c 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include "zd_ieee80211.h" | 28 | #include "zd_ieee80211.h" |
29 | #include "zd_mac.h" | 29 | #include "zd_mac.h" |
30 | #include "zd_rf.h" | 30 | #include "zd_rf.h" |
31 | #include "zd_util.h" | ||
32 | 31 | ||
33 | void zd_chip_init(struct zd_chip *chip, | 32 | void zd_chip_init(struct zd_chip *chip, |
34 | struct net_device *netdev, | 33 | struct net_device *netdev, |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 06b342b39792..a903645e157a 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include "zd_ieee80211.h" | 28 | #include "zd_ieee80211.h" |
29 | #include "zd_netdev.h" | 29 | #include "zd_netdev.h" |
30 | #include "zd_rf.h" | 30 | #include "zd_rf.h" |
31 | #include "zd_util.h" | ||
32 | 31 | ||
33 | static void ieee_init(struct ieee80211_device *ieee); | 32 | static void ieee_init(struct ieee80211_device *ieee); |
34 | static void softmac_init(struct ieee80211softmac_device *sm); | 33 | static void softmac_init(struct ieee80211softmac_device *sm); |
@@ -1066,7 +1065,8 @@ static int fill_rx_stats(struct ieee80211_rx_stats *stats, | |||
1066 | { | 1065 | { |
1067 | const struct rx_status *status; | 1066 | const struct rx_status *status; |
1068 | 1067 | ||
1069 | *pstatus = status = zd_tail(buffer, length, sizeof(struct rx_status)); | 1068 | *pstatus = status = (struct rx_status *) |
1069 | (buffer + (length - sizeof(struct rx_status))); | ||
1070 | if (status->frame_status & ZD_RX_ERROR) { | 1070 | if (status->frame_status & ZD_RX_ERROR) { |
1071 | struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); | 1071 | struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); |
1072 | ieee->stats.rx_errors++; | 1072 | ieee->stats.rx_errors++; |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 895ff8441874..721d737e8d21 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include "zd_netdev.h" | 31 | #include "zd_netdev.h" |
32 | #include "zd_mac.h" | 32 | #include "zd_mac.h" |
33 | #include "zd_usb.h" | 33 | #include "zd_usb.h" |
34 | #include "zd_util.h" | ||
35 | 34 | ||
36 | static struct usb_device_id usb_ids[] = { | 35 | static struct usb_device_id usb_ids[] = { |
37 | /* ZD1211 */ | 36 | /* ZD1211 */ |
diff --git a/drivers/net/wireless/zd1211rw/zd_util.c b/drivers/net/wireless/zd1211rw/zd_util.c deleted file mode 100644 index d20036c15d11..000000000000 --- a/drivers/net/wireless/zd1211rw/zd_util.c +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* zd_util.c | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation; either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | * | ||
17 | * Utility program | ||
18 | */ | ||
19 | |||
20 | #include "zd_def.h" | ||
21 | #include "zd_util.h" | ||
22 | |||
23 | #ifdef DEBUG | ||
24 | static char hex(u8 v) | ||
25 | { | ||
26 | v &= 0xf; | ||
27 | return (v < 10 ? '0' : 'a' - 10) + v; | ||
28 | } | ||
29 | |||
30 | static char hex_print(u8 c) | ||
31 | { | ||
32 | return (0x20 <= c && c < 0x7f) ? c : '.'; | ||
33 | } | ||
34 | |||
35 | static void dump_line(const u8 *bytes, size_t size) | ||
36 | { | ||
37 | char c; | ||
38 | size_t i; | ||
39 | |||
40 | size = size <= 8 ? size : 8; | ||
41 | printk(KERN_DEBUG "zd1211 %p ", bytes); | ||
42 | for (i = 0; i < 8; i++) { | ||
43 | switch (i) { | ||
44 | case 1: | ||
45 | case 5: | ||
46 | c = '.'; | ||
47 | break; | ||
48 | case 3: | ||
49 | c = ':'; | ||
50 | break; | ||
51 | default: | ||
52 | c = ' '; | ||
53 | } | ||
54 | if (i < size) { | ||
55 | printk("%c%c%c", hex(bytes[i] >> 4), hex(bytes[i]), c); | ||
56 | } else { | ||
57 | printk(" %c", c); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | for (i = 0; i < size; i++) | ||
62 | printk("%c", hex_print(bytes[i])); | ||
63 | printk("\n"); | ||
64 | } | ||
65 | |||
66 | void zd_hexdump(const void *bytes, size_t size) | ||
67 | { | ||
68 | size_t i = 0; | ||
69 | |||
70 | do { | ||
71 | dump_line((u8 *)bytes + i, size-i); | ||
72 | i += 8; | ||
73 | } while (i < size); | ||
74 | } | ||
75 | #endif /* DEBUG */ | ||
76 | |||
77 | void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size) | ||
78 | { | ||
79 | if (buffer_size < tail_size) | ||
80 | return NULL; | ||
81 | return (u8 *)buffer + (buffer_size - tail_size); | ||
82 | } | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_util.h b/drivers/net/wireless/zd1211rw/zd_util.h deleted file mode 100644 index ce26f7adea92..000000000000 --- a/drivers/net/wireless/zd1211rw/zd_util.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* zd_util.h | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation; either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | |||
18 | #ifndef _ZD_UTIL_H | ||
19 | #define _ZD_UTIL_H | ||
20 | |||
21 | void *zd_tail(const void *buffer, size_t buffer_size, size_t tail_size); | ||
22 | |||
23 | #ifdef DEBUG | ||
24 | void zd_hexdump(const void *bytes, size_t size); | ||
25 | #else | ||
26 | #define zd_hexdump(bytes, size) | ||
27 | #endif /* DEBUG */ | ||
28 | |||
29 | #endif /* _ZD_UTIL_H */ | ||