Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10273
b: refs/heads/master
c: d133ae4
h: refs/heads/master
i:
  10271: d3b5912
v: v3
  • Loading branch information
Pavel Roskin authored and Jeff Garzik committed Sep 23, 2005
1 parent 4ee79d9 commit 2f87859
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 98 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 393da59834eef526fc6fd0df321e94344d7c49e3
refs/heads/master: d133ae4cd6a3c75c31b1630f906cc9979a11077f
108 changes: 54 additions & 54 deletions trunk/drivers/net/wireless/hermes.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@
#define HERMES_RXSTAT_WMP (0x6000) /* Wavelan-II Management Protocol frame */

struct hermes_tx_descriptor {
u16 status;
u16 reserved1;
u16 reserved2;
u32 sw_support;
__le16 status;
__le16 reserved1;
__le16 reserved2;
__le32 sw_support;
u8 retry_count;
u8 tx_rate;
u16 tx_control;
__le16 tx_control;
} __attribute__ ((packed));

#define HERMES_TXSTAT_RETRYERR (0x0001)
Expand All @@ -221,77 +221,77 @@ struct hermes_tx_descriptor {
#define HERMES_INQ_SEC_STAT_AGERE (0xF202)

struct hermes_tallies_frame {
u16 TxUnicastFrames;
u16 TxMulticastFrames;
u16 TxFragments;
u16 TxUnicastOctets;
u16 TxMulticastOctets;
u16 TxDeferredTransmissions;
u16 TxSingleRetryFrames;
u16 TxMultipleRetryFrames;
u16 TxRetryLimitExceeded;
u16 TxDiscards;
u16 RxUnicastFrames;
u16 RxMulticastFrames;
u16 RxFragments;
u16 RxUnicastOctets;
u16 RxMulticastOctets;
u16 RxFCSErrors;
u16 RxDiscards_NoBuffer;
u16 TxDiscardsWrongSA;
u16 RxWEPUndecryptable;
u16 RxMsgInMsgFragments;
u16 RxMsgInBadMsgFragments;
__le16 TxUnicastFrames;
__le16 TxMulticastFrames;
__le16 TxFragments;
__le16 TxUnicastOctets;
__le16 TxMulticastOctets;
__le16 TxDeferredTransmissions;
__le16 TxSingleRetryFrames;
__le16 TxMultipleRetryFrames;
__le16 TxRetryLimitExceeded;
__le16 TxDiscards;
__le16 RxUnicastFrames;
__le16 RxMulticastFrames;
__le16 RxFragments;
__le16 RxUnicastOctets;
__le16 RxMulticastOctets;
__le16 RxFCSErrors;
__le16 RxDiscards_NoBuffer;
__le16 TxDiscardsWrongSA;
__le16 RxWEPUndecryptable;
__le16 RxMsgInMsgFragments;
__le16 RxMsgInBadMsgFragments;
/* Those last are probably not available in very old firmwares */
u16 RxDiscards_WEPICVError;
u16 RxDiscards_WEPExcluded;
__le16 RxDiscards_WEPICVError;
__le16 RxDiscards_WEPExcluded;
} __attribute__ ((packed));

/* Grabbed from wlan-ng - Thanks Mark... - Jean II
* This is the result of a scan inquiry command */
/* Structure describing info about an Access Point */
struct prism2_scan_apinfo {
u16 channel; /* Channel where the AP sits */
u16 noise; /* Noise level */
u16 level; /* Signal level */
__le16 channel; /* Channel where the AP sits */
__le16 noise; /* Noise level */
__le16 level; /* Signal level */
u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
u16 beacon_interv; /* Beacon interval */
u16 capabilities; /* Capabilities */
u16 essid_len; /* ESSID length */
__le16 beacon_interv; /* Beacon interval */
__le16 capabilities; /* Capabilities */
__le16 essid_len; /* ESSID length */
u8 essid[32]; /* ESSID of the network */
u8 rates[10]; /* Bit rate supported */
u16 proberesp_rate; /* Data rate of the response frame */
u16 atim; /* ATIM window time, Kus (hostscan only) */
__le16 proberesp_rate; /* Data rate of the response frame */
__le16 atim; /* ATIM window time, Kus (hostscan only) */
} __attribute__ ((packed));

/* Same stuff for the Lucent/Agere card.
* Thanks to h1kari <h1kari AT dachb0den.com> - Jean II */
struct agere_scan_apinfo {
u16 channel; /* Channel where the AP sits */
u16 noise; /* Noise level */
u16 level; /* Signal level */
__le16 channel; /* Channel where the AP sits */
__le16 noise; /* Noise level */
__le16 level; /* Signal level */
u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
u16 beacon_interv; /* Beacon interval */
u16 capabilities; /* Capabilities */
__le16 beacon_interv; /* Beacon interval */
__le16 capabilities; /* Capabilities */
/* bits: 0-ess, 1-ibss, 4-privacy [wep] */
u16 essid_len; /* ESSID length */
__le16 essid_len; /* ESSID length */
u8 essid[32]; /* ESSID of the network */
} __attribute__ ((packed));

/* Moustafa: Scan structure for Symbol cards */
struct symbol_scan_apinfo {
u8 channel; /* Channel where the AP sits */
u8 unknown1; /* 8 in 2.9x and 3.9x f/w, 0 otherwise */
u16 noise; /* Noise level */
u16 level; /* Signal level */
__le16 noise; /* Noise level */
__le16 level; /* Signal level */
u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
u16 beacon_interv; /* Beacon interval */
u16 capabilities; /* Capabilities */
__le16 beacon_interv; /* Beacon interval */
__le16 capabilities; /* Capabilities */
/* bits: 0-ess, 1-ibss, 4-privacy [wep] */
u16 essid_len; /* ESSID length */
__le16 essid_len; /* ESSID length */
u8 essid[32]; /* ESSID of the network */
u16 rates[5]; /* Bit rate supported */
u16 basic_rates; /* Basic rates bitmask */
__le16 rates[5]; /* Bit rate supported */
__le16 basic_rates; /* Basic rates bitmask */
u8 unknown2[6]; /* Always FF:FF:FF:FF:00:00 */
u8 unknown3[8]; /* Always 0, appeared in f/w 3.91-68 */
} __attribute__ ((packed));
Expand All @@ -311,7 +311,7 @@ union hermes_scan_info {
#define HERMES_LINKSTATUS_ASSOC_FAILED (0x0006)

struct hermes_linkstatus {
u16 linkstatus; /* Link status */
__le16 linkstatus; /* Link status */
} __attribute__ ((packed));

struct hermes_response {
Expand All @@ -320,8 +320,8 @@ struct hermes_response {

/* "ID" structure - used for ESSID and station nickname */
struct hermes_idstring {
u16 len;
u16 val[16];
__le16 len;
__le16 val[16];
} __attribute__ ((packed));

struct hermes_multicast {
Expand Down Expand Up @@ -446,7 +446,7 @@ static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count

static inline int hermes_read_wordrec(hermes_t *hw, int bap, u16 rid, u16 *word)
{
u16 rec;
__le16 rec;
int err;

err = HERMES_READ_RECORD(hw, bap, rid, &rec);
Expand All @@ -456,7 +456,7 @@ static inline int hermes_read_wordrec(hermes_t *hw, int bap, u16 rid, u16 *word)

static inline int hermes_write_wordrec(hermes_t *hw, int bap, u16 rid, u16 word)
{
u16 rec = cpu_to_le16(word);
__le16 rec = cpu_to_le16(word);
return HERMES_WRITE_RECORD(hw, bap, rid, &rec);
}

Expand Down
62 changes: 32 additions & 30 deletions trunk/drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,63 +202,64 @@ static struct {
/********************************************************************/

/* Used in Event handling.
* We avoid nested structres as they break on ARM -- Moustafa */
* We avoid nested structures as they break on ARM -- Moustafa */
struct hermes_tx_descriptor_802_11 {
/* hermes_tx_descriptor */
u16 status;
u16 reserved1;
u16 reserved2;
u32 sw_support;
__le16 status;
__le16 reserved1;
__le16 reserved2;
__le32 sw_support;
u8 retry_count;
u8 tx_rate;
u16 tx_control;
__le16 tx_control;

/* ieee802_11_hdr */
u16 frame_ctl;
u16 duration_id;
/* ieee80211_hdr */
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
u16 seq_ctl;
__le16 seq_ctl;
u8 addr4[ETH_ALEN];
u16 data_len;

__le16 data_len;

/* ethhdr */
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
u8 h_dest[ETH_ALEN]; /* destination eth addr */
u8 h_source[ETH_ALEN]; /* source ether addr */
__be16 h_proto; /* packet type ID field */

/* p8022_hdr */
u8 dsap;
u8 ssap;
u8 ctrl;
u8 oui[3];

u16 ethertype;
__be16 ethertype;
} __attribute__ ((packed));

/* Rx frame header except compatibility 802.3 header */
struct hermes_rx_descriptor {
/* Control */
u16 status;
u32 time;
__le16 status;
__le32 time;
u8 silence;
u8 signal;
u8 rate;
u8 rxflow;
u32 reserved;
__le32 reserved;

/* 802.11 header */
u16 frame_ctl;
u16 duration_id;
__le16 frame_ctl;
__le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
u16 seq_ctl;
__le16 seq_ctl;
u8 addr4[ETH_ALEN];

/* Data length */
u16 data_len;
__le16 data_len;
} __attribute__ ((packed));

/********************************************************************/
Expand Down Expand Up @@ -389,7 +390,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
}
} else {
struct {
u16 qual, signal, noise;
__le16 qual, signal, noise;
} __attribute__ ((packed)) cq;

err = HERMES_READ_RECORD(hw, USER_BAP,
Expand Down Expand Up @@ -615,6 +616,7 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
struct orinoco_private *priv = netdev_priv(dev);
struct net_device_stats *stats = &priv->stats;
u16 fid = hermes_read_regn(hw, TXCOMPLFID);
u16 status;
struct hermes_tx_descriptor_802_11 hdr;
int err = 0;

Expand Down Expand Up @@ -644,8 +646,8 @@ static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
* exceeded, because that's the only status that really mean
* that this particular node went away.
* Other errors means that *we* screwed up. - Jean II */
hdr.status = le16_to_cpu(hdr.status);
if (hdr.status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) {
status = le16_to_cpu(hdr.status);
if (status & (HERMES_TXSTAT_RETRYERR | HERMES_TXSTAT_AGEDERR)) {
union iwreq_data wrqu;

/* Copy 802.11 dest address.
Expand Down Expand Up @@ -1031,7 +1033,7 @@ static void orinoco_join_ap(struct net_device *dev)
unsigned long flags;
struct join_req {
u8 bssid[ETH_ALEN];
u16 channel;
__le16 channel;
} __attribute__ ((packed)) req;
const int atom_len = offsetof(struct prism2_scan_apinfo, atim);
struct prism2_scan_apinfo *atom = NULL;
Expand Down Expand Up @@ -1128,8 +1130,8 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
struct orinoco_private *priv = netdev_priv(dev);
u16 infofid;
struct {
u16 len;
u16 type;
__le16 len;
__le16 type;
} __attribute__ ((packed)) info;
int len, type;
int err;
Expand Down Expand Up @@ -3905,7 +3907,7 @@ static int orinoco_ioctl_setscan(struct net_device *dev,
HERMES_HOSTSCAN_SYMBOL_BCAST);
break;
case FIRMWARE_TYPE_INTERSIL: {
u16 req[3];
__le16 req[3];

req[0] = cpu_to_le16(0x3fff); /* All channels */
req[1] = cpu_to_le16(0x0001); /* rate 1 Mbps */
Expand Down Expand Up @@ -3979,7 +3981,7 @@ static inline int orinoco_translate_scan(struct net_device *dev,
case FIRMWARE_TYPE_INTERSIL:
offset = 4;
if (priv->has_hostscan) {
atom_len = le16_to_cpup((u16 *)scan);
atom_len = le16_to_cpup((__le16 *)scan);
/* Sanity check for atom_len */
if (atom_len < sizeof(struct prism2_scan_apinfo)) {
printk(KERN_ERR "%s: Invalid atom_len in scan data: %d\n",
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/orinoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
#define ORINOCO_MAX_KEYS 4

struct orinoco_key {
u16 len; /* always stored as little-endian */
__le16 len; /* always stored as little-endian */
char data[ORINOCO_MAX_KEY_SIZE];
} __attribute__ ((packed));

struct header_struct {
/* 802.3 */
u8 dest[ETH_ALEN];
u8 src[ETH_ALEN];
u16 len;
__be16 len;
/* 802.2 */
u8 dsap;
u8 ssap;
u8 ctrl;
/* SNAP */
u8 oui[3];
u16 ethertype;
unsigned short ethertype;
} __attribute__ ((packed));

typedef enum {
Expand Down
Loading

0 comments on commit 2f87859

Please sign in to comment.