Author: adrian
Date: Sat Jun 16 04:41:35 2012
New Revision: 237153
URL: http://svn.freebsd.org/changeset/base/237153

Log:
  Shuffle some more fields in ath_buf so it's not too big.
  
  This shaves off 20 bytes - from 288 bytes to 268 bytes.
  
  However, it's still too big.

Modified:
  head/sys/dev/ath/ath_hal/ah_desc.h
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah_desc.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_desc.h  Sat Jun 16 04:36:08 2012        
(r237152)
+++ head/sys/dev/ath/ath_hal/ah_desc.h  Sat Jun 16 04:41:35 2012        
(r237153)
@@ -225,6 +225,7 @@ struct ath_desc_status {
 #define        ds_rxstat       ds_us.rx
 
 /* flags passed to tx descriptor setup methods */
+/* This is a uint16_t field in ath_buf, just be warned! */
 #define        HAL_TXDESC_CLRDMASK     0x0001  /* clear destination filter 
mask */
 #define        HAL_TXDESC_NOACK        0x0002  /* don't wait for ACK */
 #define        HAL_TXDESC_RTSENA       0x0004  /* enable RTS */

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c   Sat Jun 16 04:36:08 2012        (r237152)
+++ head/sys/dev/ath/if_ath.c   Sat Jun 16 04:41:35 2012        (r237153)
@@ -662,6 +662,9 @@ ath_attach(u_int16_t devid, struct ath_s
                (void) ath_hal_settxchainmask(sc->sc_ah, tx_chainmask);
        }
 
+       device_printf(sc->sc_dev, "%s: sizeof(ath_buf) = %d bytes\n",
+           __func__, sizeof(struct ath_buf));
+
 #ifdef ATH_ENABLE_11N
        /*
         * Query HT capabilities

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h        Sat Jun 16 04:36:08 2012        
(r237152)
+++ head/sys/dev/ath/if_athvar.h        Sat Jun 16 04:41:35 2012        
(r237153)
@@ -236,20 +236,32 @@ struct ath_buf {
                 * These fields are passed into the
                 * descriptor setup functions.
                 */
+
+               /* Make this an 8 bit value? */
                HAL_PKT_TYPE bfs_atype; /* packet type */
-               int bfs_pktlen;         /* length of this packet */
-               int bfs_hdrlen;         /* length of this packet header */
+
+               uint32_t bfs_pktlen;    /* length of this packet */
+
+               uint16_t bfs_hdrlen;    /* length of this packet header */
                uint16_t bfs_al;        /* length of aggregate */
-               int bfs_txflags;        /* HAL (tx) descriptor flags */
-               int bfs_txrate0;        /* first TX rate */
-               int bfs_try0;           /* first try count */
+
+               uint16_t bfs_txflags;   /* HAL (tx) descriptor flags */
+               uint8_t bfs_txrate0;    /* first TX rate */
+               uint8_t bfs_try0;               /* first try count */
+
+               uint16_t bfs_txpower;   /* tx power */
                uint8_t bfs_ctsrate0;   /* Non-zero - use this as ctsrate */
-               int bfs_keyix;          /* crypto key index */
-               int bfs_txpower;        /* tx power */
-               int bfs_txantenna;      /* TX antenna config */
+               uint8_t bfs_ctsrate;    /* CTS rate */
+
+               /* 16 bit? */
+               int32_t bfs_keyix;              /* crypto key index */
+               int32_t bfs_txantenna;  /* TX antenna config */
+
+               /* Make this an 8 bit value? */
                enum ieee80211_protmode bfs_protmode;
-               int bfs_ctsrate;        /* CTS rate */
-               int bfs_ctsduration;    /* CTS duration (pre-11n NICs) */
+
+               /* 16 bit? */
+               uint32_t bfs_ctsduration;       /* CTS duration (pre-11n NICs) 
*/
                struct ath_rc_series bfs_rc[ATH_RC_NUM];        /* non-11n TX 
series */
        } bf_state;
 };
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to