logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

revision 2568 committed: msg#00041

Subject: revision 2568 committed
Project     : madwifi
Revision    : 2568
Author      : proski (Pavel Roskin)
Date        : 2007-07-09 15:37:26 +0200 (Mon, 09 Jul 2007)

Log Message :
Eliminate typedefs for structures, they are not recommended in Linux

Affected Files:
* trunk/ath/if_ath.c                                  updated             
* trunk/net80211/ieee80211_monitor.c                  updated             
* trunk/net80211/ieee80211_monitor.h                  updated             
* trunk/net80211/ieee80211_proto.c                    updated             


Modified: trunk/ath/if_ath.c
===================================================================
--- trunk/ath/if_ath.c  2007-07-09 13:13:50 UTC (rev 2567)
+++ trunk/ath/if_ath.c  2007-07-09 13:37:26 UTC (rev 2568)
@@ -5253,7 +5253,8 @@
                if (sc->sc_nmonvaps > 0) {
                        u_int off;
                        unsigned int extra = A_MAX(sizeof(struct 
ath_rx_radiotap_header),
-                                         A_MAX(sizeof(wlan_ng_prism2_header), 
ATHDESC_HEADER_SIZE));
+                                                  A_MAX(sizeof(struct 
wlan_ng_prism2_header),
+                                                        ATHDESC_HEADER_SIZE));
 
                        /*
                         * Allocate buffer for monitor mode with space for the
@@ -5271,7 +5272,7 @@
                        /*
                         * Reserve space for the Prism header.
                         */
-                       skb_reserve(skb, sizeof(wlan_ng_prism2_header));
+                       skb_reserve(skb, sizeof(struct wlan_ng_prism2_header));
                        /*
                         * Align to cache line.
                         */
@@ -5378,7 +5379,8 @@
        struct ieee80211com *ic = &sc->sc_ic;
        struct ieee80211_frame *wh;
        unsigned int extra = A_MAX(sizeof(struct ath_tx_radiotap_header),
-                         A_MAX(sizeof(wlan_ng_prism2_header), 
ATHDESC_HEADER_SIZE));
+                                  A_MAX(sizeof(struct wlan_ng_prism2_header),
+                                        ATHDESC_HEADER_SIZE));
        u_int32_t tstamp;
        unsigned int headersize;
        int padbytes;
@@ -5962,12 +5964,12 @@
        struct ath_desc *ds = NULL;
        int rates[XR_NUM_RATES];
        u_int8_t ratestr[16], numpollstr[16];
-       typedef struct rate_to_str_map {
+       struct rate_to_str_map {
                u_int8_t str[4];
                int ratekbps;
-       } RATE_TO_STR_MAP;
+       };
 
-       static const RATE_TO_STR_MAP ratestrmap[] = {
+       static const struct rate_to_str_map ratestrmap[] = {
                {"0.25",    250},
                { ".25",    250},
                { "0.5",    500},

Modified: trunk/net80211/ieee80211_monitor.c
===================================================================
--- trunk/net80211/ieee80211_monitor.c  2007-07-09 13:13:50 UTC (rev 2567)
+++ trunk/net80211/ieee80211_monitor.c  2007-07-09 13:37:26 UTC (rev 2568)
@@ -151,14 +151,14 @@
        }
        case ARPHRD_IEEE80211_PRISM: {
                struct ieee80211_frame *wh = NULL;
-               wlan_ng_prism2_header *p2h =
-                       (wlan_ng_prism2_header *) skb->data;
+               struct wlan_ng_prism2_header *p2h =
+                       (struct wlan_ng_prism2_header *) skb->data;
                /* does it look like there is a prism header here? */
-               if (skb->len > sizeof (wlan_ng_prism2_header) &&
+               if (skb->len > sizeof(struct wlan_ng_prism2_header) &&
                        p2h->msgcode == DIDmsg_lnxind_wlansniffrm &&
                    p2h->rate.did == DIDmsg_lnxind_wlansniffrm_rate) {
                            ph->rate0 = p2h->rate.data;
-                           skb_pull(skb, sizeof(wlan_ng_prism2_header));
+                           skb_pull(skb, sizeof(struct wlan_ng_prism2_header));
                }
                wh = (struct ieee80211_frame *) skb->data;
                if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == 
IEEE80211_FC0_TYPE_CTL)
@@ -385,19 +385,19 @@
                case ARPHRD_IEEE80211:
                        break;
                case ARPHRD_IEEE80211_PRISM: {
-                       wlan_ng_prism2_header *ph;
-                       if (skb_headroom(skb1) < sizeof(wlan_ng_prism2_header)) 
{
+                       struct wlan_ng_prism2_header *ph;
+                       if (skb_headroom(skb1) < sizeof(struct 
wlan_ng_prism2_header)) {
                                dev_kfree_skb(skb1);
                                skb1 = NULL;
                                break;
                        }
 
-                       ph = (wlan_ng_prism2_header *)
-                               skb_push(skb1, sizeof(wlan_ng_prism2_header));
-                       memset(ph, 0, sizeof(wlan_ng_prism2_header));
+                       ph = (struct wlan_ng_prism2_header *)
+                               skb_push(skb1, sizeof(struct 
wlan_ng_prism2_header));
+                       memset(ph, 0, sizeof(struct wlan_ng_prism2_header));
 
                        ph->msgcode = DIDmsg_lnxind_wlansniffrm;
-                       ph->msglen = sizeof(wlan_ng_prism2_header);
+                       ph->msglen = sizeof(struct wlan_ng_prism2_header);
                        strncpy(ph->devname, dev->name, sizeof(ph->devname));
 
                        ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime;

Modified: trunk/net80211/ieee80211_monitor.h
===================================================================
--- trunk/net80211/ieee80211_monitor.h  2007-07-09 13:13:50 UTC (rev 2567)
+++ trunk/net80211/ieee80211_monitor.h  2007-07-09 13:37:26 UTC (rev 2568)
@@ -79,29 +79,29 @@
        P80211ENUM_truth_true                   = 0x01
 };
 
-typedef struct {
+struct p80211item_uint32 {
        u_int32_t did;
        u_int16_t status;
        u_int16_t len;
        u_int32_t data;
-} p80211item_uint32_t;
+};
 
-typedef struct {
+struct wlan_ng_prism2_header {
        u_int32_t msgcode;
        u_int32_t msglen;
 #define WLAN_DEVNAMELEN_MAX 16
        u_int8_t devname[WLAN_DEVNAMELEN_MAX];
-       p80211item_uint32_t hosttime;
-       p80211item_uint32_t mactime;
-       p80211item_uint32_t channel;
-       p80211item_uint32_t rssi;
-       p80211item_uint32_t sq;
-       p80211item_uint32_t signal;
-       p80211item_uint32_t noise;
-       p80211item_uint32_t rate;
-       p80211item_uint32_t istx;
-       p80211item_uint32_t frmlen;
-} wlan_ng_prism2_header;
+       struct p80211item_uint32 hosttime;
+       struct p80211item_uint32 mactime;
+       struct p80211item_uint32 channel;
+       struct p80211item_uint32 rssi;
+       struct p80211item_uint32 sq;
+       struct p80211item_uint32 signal;
+       struct p80211item_uint32 noise;
+       struct p80211item_uint32 rate;
+       struct p80211item_uint32 istx;
+       struct p80211item_uint32 frmlen;
+};
 
 #define ATH_RX_RADIOTAP_PRESENT (               \
        (1 << IEEE80211_RADIOTAP_TSFT)          | \

Modified: trunk/net80211/ieee80211_proto.c
===================================================================
--- trunk/net80211/ieee80211_proto.c    2007-07-09 13:13:50 UTC (rev 2567)
+++ trunk/net80211/ieee80211_proto.c    2007-07-09 13:37:26 UTC (rev 2568)
@@ -645,16 +645,16 @@
 {
        struct ieee80211com *ic = vap->iv_ic;
        struct ieee80211_wme_state *wme = &ic->ic_wme;
-       typedef struct phyParamType {
+       struct phyParamType {
                u_int8_t aifsn;
                u_int8_t logcwmin;
                u_int8_t logcwmax;
                u_int16_t txopLimit;
                u_int8_t acm;
-       } paramType;
+       };
        enum ieee80211_phymode mode;
 
-       paramType *pPhyParam, *pBssPhyParam;
+       struct phyParamType *pPhyParam, *pBssPhyParam;
 
        static struct phyParamType phyParamForAC_BE[IEEE80211_MODE_MAX] = {
                /* IEEE80211_MODE_AUTO  */ { 3, 4,  6,   0, 0 },

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


<Prev in Thread] Current Thread [Next in Thread>