aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2005-09-23 04:18:06 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-23 04:36:13 -0400
commitd133ae4cd6a3c75c31b1630f906cc9979a11077f (patch)
tree4b292054c342e6e8c5b2594c62cbf3534eea1edf /drivers/net/wireless/orinoco.c
parent393da59834eef526fc6fd0df321e94344d7c49e3 (diff)
[PATCH] orinoco: Annotate endianess of variables and structure members.
Signed-off-by: Pavel Roskin <proski@gnu.org> Annotate endianess of variables and structure members. Don't reuse variables for both host-endian and little-endian data. Minor comment changes in affected structures. Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 29cb5d81b67e..1ae301c62281 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -202,31 +202,32 @@ static struct {
202/********************************************************************/ 202/********************************************************************/
203 203
204/* Used in Event handling. 204/* Used in Event handling.
205 * We avoid nested structres as they break on ARM -- Moustafa */ 205 * We avoid nested structures as they break on ARM -- Moustafa */
206struct hermes_tx_descriptor_802_11 { 206struct hermes_tx_descriptor_802_11 {
207 /* hermes_tx_descriptor */ 207 /* hermes_tx_descriptor */
208 u16 status; 208 __le16 status;
209 u16 reserved1; 209 __le16 reserved1;
210 u16 reserved2; 210 __le16 reserved2;
211 u32 sw_support; 211 __le32 sw_support;
212 u8 retry_count; 212 u8 retry_count;
213 u8 tx_rate; 213 u8 tx_rate;
214 u16 tx_control; 214 __le16 tx_control;
215 215
216 /* ieee802_11_hdr */ 216 /* ieee80211_hdr */
217 u16 frame_ctl; 217 __le16 frame_ctl;
218 u16 duration_id; 218 __le16 duration_id;
219 u8 addr1[ETH_ALEN]; 219 u8 addr1[ETH_ALEN];
220 u8 addr2[ETH_ALEN]; 220 u8 addr2[ETH_ALEN];
221 u8 addr3[ETH_ALEN]; 221 u8 addr3[ETH_ALEN];
222 u16 seq_ctl; 222 __le16 seq_ctl;
223 u8 addr4[ETH_ALEN]; 223 u8 addr4[ETH_ALEN];
224 u16 data_len; 224
225 __le16 data_len;
225 226
226 /* ethhdr */ 227 /* ethhdr */
227 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 228 u8 h_dest[ETH_ALEN]; /* destination eth addr */
228 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 229 u8 h_source[ETH_ALEN]; /* source ether addr */
229 unsigned short h_proto; /* packet type ID field */ 230 __be16 h_proto; /* packet type ID field */
230 231
231 /* p8022_hdr */ 232 /* p8022_hdr */
232 u8 dsap; 233 u8 dsap;
@@ -234,31 +235,31 @@ struct hermes_tx_descriptor_802_11 {
234 u8 ctrl; 235 u8 ctrl;
235 u8 oui[3]; 236 u8 oui[3];
236 237
237 u16 ethertype; 238 __be16 ethertype;
238} __attribute__ ((packed)); 239} __attribute__ ((packed));
239 240
240/* Rx frame header except compatibility 802.3 header */ 241/* Rx frame header except compatibility 802.3 header */
241struct hermes_rx_descriptor { 242struct hermes_rx_descriptor {
242 /* Control */ 243 /* Control */
243 u16 status; 244 __le16 status;
244 u32 time; 245 __le32 time;
245 u8 silence; 246 u8 silence;
246 u8 signal; 247 u8 signal;
247 u8 rate; 248 u8 rate;
248 u8 rxflow; 249 u8 rxflow;
249 u32 reserved; 250 __le32 reserved;
250 251
251 /* 802.11 header */ 252 /* 802.11 header */
252 u16 frame_ctl; 253 __le16 frame_ctl;
253 u16 duration_id; 254 __le16 duration_id;
254 u8 addr1[ETH_ALEN]; 255 u8 addr1[ETH_ALEN];
255 u8 addr2[ETH_ALEN]; 256 u8 addr2[ETH_ALEN];
256 u8 addr3[ETH_ALEN]; 257 u8 addr3[ETH_ALEN];
257 u16 seq_ctl; 258 __le16 seq_ctl;
258 u8 addr4[ETH_ALEN]; 259 u8 addr4[ETH_ALEN];
259 260
260 /* Data length */ 261 /* Data length */
261 u16 data_len; 262 __le16 data_len;
262} __attribute__ ((packed)); 263} __attribute__ ((packed));
263 264
264/********************************************************************/ 265/********************************************************************/
@@ -389,7 +390,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
389 } 390 }
390 } else { 391 } else {
391 struct { 392 struct {
392 u16 qual, signal, noise; 393 __le16 qual, signal, noise;
393 } __attribute__ ((packed)) cq; 394 } __attribute__ ((packed)) cq;
394 395
395 err = HERMES_READ_RECORD(hw, USER_BAP, 396 err = HERMES_READ_RECORD(hw, USER_BAP,
@@ -615,6 +616,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
615 struct orinoco_private *priv = netdev_priv(dev); 616 struct orinoco_private *priv = netdev_priv(dev);
616 struct net_device_stats *stats = &priv->stats; 617 struct net_device_stats *stats = &priv->stats;
617 u16 fid = hermes_read_regn(hw, TXCOMPLFID); 618 u16 fid = hermes_read_regn(hw, TXCOMPLFID);
619 u16 status;
618 struct hermes_tx_descriptor_802_11 hdr; 620 struct hermes_tx_descriptor_802_11 hdr;
619 int err = 0; 621 int err = 0;
620 622
@@ -644,8 +646,8 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
644 * exceeded, because that's the only status that really mean 646 * exceeded, because that's the only status that really mean
645 * that this particular node went away. 647 * that this particular node went away.
646 * Other errors means that *we* screwed up. - Jean II */ 648 * Other errors means that *we* screwed up. - Jean II */
647 hdr.status = le16_to_cpu(hdr.status); 649 status = le16_to_cpu(hdr.status);
648 if (hdr.status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) { 650 if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) {
649 union iwreq_data wrqu; 651 union iwreq_data wrqu;
650 652
651 /* Copy 802.11 dest address. 653 /* Copy 802.11 dest address.
@@ -1031,7 +1033,7 @@ static void orinoco_join_ap(struct net_device *dev)
1031 unsigned long flags; 1033 unsigned long flags;
1032 struct join_req { 1034 struct join_req {
1033 u8 bssid[ETH_ALEN]; 1035 u8 bssid[ETH_ALEN];
1034 u16 channel; 1036 __le16 channel;
1035 } __attribute__ ((packed)) req; 1037 } __attribute__ ((packed)) req;
1036 const int atom_len = offsetof(struct prism2_scan_apinfo, atim); 1038 const int atom_len = offsetof(struct prism2_scan_apinfo, atim);
1037 struct prism2_scan_apinfo *atom = NULL; 1039 struct prism2_scan_apinfo *atom = NULL;
@@ -1128,8 +1130,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
1128 struct orinoco_private *priv = netdev_priv(dev); 1130 struct orinoco_private *priv = netdev_priv(dev);
1129 u16 infofid; 1131 u16 infofid;
1130 struct { 1132 struct {
1131 u16 len; 1133 __le16 len;
1132 u16 type; 1134 __le16 type;
1133 } __attribute__ ((packed)) info; 1135 } __attribute__ ((packed)) info;
1134 int len, type; 1136 int len, type;
1135 int err; 1137 int err;
@@ -3905,7 +3907,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev,
3905 HERMES_HOSTSCAN_SYMBOL_BCAST); 3907 HERMES_HOSTSCAN_SYMBOL_BCAST);
3906 break; 3908 break;
3907 case FIRMWARE_TYPE_INTERSIL: { 3909 case FIRMWARE_TYPE_INTERSIL: {
3908 u16 req[3]; 3910 __le16 req[3];
3909 3911
3910 req[0] = cpu_to_le16(0x3fff); /* All channels */ 3912 req[0] = cpu_to_le16(0x3fff); /* All channels */
3911 req[1] = cpu_to_le16(0x0001); /* rate 1 Mbps */ 3913 req[1] = cpu_to_le16(0x0001); /* rate 1 Mbps */
@@ -3979,7 +3981,7 @@ static inline int orinoco_translate_scan(struct net_device *dev,
3979 case FIRMWARE_TYPE_INTERSIL: 3981 case FIRMWARE_TYPE_INTERSIL:
3980 offset = 4; 3982 offset = 4;
3981 if (priv->has_hostscan) { 3983 if (priv->has_hostscan) {
3982 atom_len = le16_to_cpup((u16 *)scan); 3984 atom_len = le16_to_cpup((__le16 *)scan);
3983 /* Sanity check for atom_len */ 3985 /* Sanity check for atom_len */
3984 if (atom_len < sizeof(struct prism2_scan_apinfo)) { 3986 if (atom_len < sizeof(struct prism2_scan_apinfo)) {
3985 printk(KERN_ERR "%s: Invalid atom_len in scan data: %d\n", 3987 printk(KERN_ERR "%s: Invalid atom_len in scan data: %d\n",