]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Staging: brcm80211: remove OFFSETOF macro
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Oct 2010 18:44:45 +0000 (11:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Oct 2010 18:44:45 +0000 (11:44 -0700)
Use the real 'offsetof' definition instead.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 files changed:
drivers/staging/brcm80211/brcmfmac/bcmutils.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
drivers/staging/brcm80211/brcmfmac/wl_iw.c
drivers/staging/brcm80211/include/bcmutils.h
drivers/staging/brcm80211/include/wlioctl.h
drivers/staging/brcm80211/phy/wlc_phy_cmn.c
drivers/staging/brcm80211/phy/wlc_phy_lcn.c
drivers/staging/brcm80211/phy/wlc_phy_n.c
drivers/staging/brcm80211/sys/wlc_alloc.c
drivers/staging/brcm80211/sys/wlc_ampdu.c
drivers/staging/brcm80211/sys/wlc_bmac.c
drivers/staging/brcm80211/sys/wlc_mac80211.c
drivers/staging/brcm80211/util/bcmutils.c
drivers/staging/brcm80211/util/hndpmu.c
drivers/staging/brcm80211/util/nicpci.c
drivers/staging/brcm80211/util/siutils.c

index 487bdca05253a9e6be6e18db7215f140db1fd5b7..1eecf1a2b64ca081041ffa8b01eb7761643fdb10 100644 (file)
@@ -305,7 +305,7 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len)
 
        /* pq is variable size; only zero out what's requested */
        bzero(pq,
-             OFFSETOF(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec));
+             offsetof(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec));
 
        pq->num_prec = (u16) num_prec;
 
index f73e4173b2b28f30673335e701862f1dc58254a9..4eed29ffc5a6b8afabc62fe32ee9bf6840e7fb61 100644 (file)
@@ -1995,7 +1995,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
                return 0;
 
        /* Read console log struct */
-       addr = bus->console_addr + OFFSETOF(hndrte_cons_t, log);
+       addr = bus->console_addr + offsetof(hndrte_cons_t, log);
        rv = dhdsdio_membytes(bus, FALSE, addr, (u8 *)&c->log,
                                sizeof(c->log));
        if (rv < 0)
@@ -4980,20 +4980,20 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
        dhdsdio_clkctl(bus, CLK_AVAIL, FALSE);
 
        /* Zero cbuf_index */
-       addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf_idx);
+       addr = bus->console_addr + offsetof(hndrte_cons_t, cbuf_idx);
        val = htol32(0);
        rv = dhdsdio_membytes(bus, TRUE, addr, (u8 *)&val, sizeof(val));
        if (rv < 0)
                goto done;
 
        /* Write message into cbuf */
-       addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf);
+       addr = bus->console_addr + offsetof(hndrte_cons_t, cbuf);
        rv = dhdsdio_membytes(bus, TRUE, addr, (u8 *)msg, msglen);
        if (rv < 0)
                goto done;
 
        /* Write length into vcons_in */
-       addr = bus->console_addr + OFFSETOF(hndrte_cons_t, vcons_in);
+       addr = bus->console_addr + offsetof(hndrte_cons_t, vcons_in);
        val = htol32(msglen);
        rv = dhdsdio_membytes(bus, TRUE, addr, (u8 *)&val, sizeof(val));
        if (rv < 0)
index f851ae2409663027c0ffe0503194c9b19760c305..2dae1a93f6b100d3fb73305eee926537f7dcac38 100644 (file)
@@ -689,7 +689,7 @@ static s32
 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
 {
        s32 params_size =
-           (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params));
+           (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params));
        struct wl_iscan_params *params;
        s32 err = 0;
 
@@ -707,7 +707,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
        params->action = htod16(action);
        params->scan_duration = htod16(0);
 
-       /* params_size += OFFSETOF(wl_iscan_params_t, params); */
+       /* params_size += offsetof(wl_iscan_params_t, params); */
        err = wl_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
                                iscan->ioctl_buf, WLC_IOCTL_SMLEN);
        if (unlikely(err)) {
index 7eecc86db34c029e2ef6ddf258c0a015c05b190b..9b5da84f4d01ee140fff45287e600cf25c5a31ef 100644 (file)
@@ -3708,12 +3708,12 @@ int wl_iw_attach(struct net_device *dev, void *dhdp)
 
 #ifdef CSCAN
        params_size =
-           (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params)) +
+           (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params)) +
            (WL_NUMCHANNELS * sizeof(u16)) +
            WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
 #else
        params_size =
-           (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params));
+           (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params));
 #endif
        iscan = kmalloc(sizeof(iscan_info_t), GFP_KERNEL);
 
index ebc869aff0d9802d85a911c0273edca3f7786167..0421247b594eb455fc737f0e273688877599d521 100644 (file)
@@ -456,9 +456,6 @@ extern "C" {
        & ~((boundary) - 1))
 #define        ISPOWEROF2(x)           ((((x)-1)&(x)) == 0)
 #define VALID_MASK(mask)       (!((mask) & ((mask) + 1)))
-#ifndef OFFSETOF
-#define        OFFSETOF(type, member)  ((uint)(uintptr)&((type *)0)->member)
-#endif                         /* OFFSETOF */
 #ifndef ARRAYSIZE
 #define ARRAYSIZE(a)           (sizeof(a)/sizeof(a[0]))
 #endif
index b5facdb53d0427ac03a343351c5d2a4db0791747..22227c1a7fb07719a204c0a9cf2a1af8c6055c4b 100644 (file)
@@ -254,7 +254,7 @@ typedef struct wl_iscan_params {
 } wl_iscan_params_t;
 
 /* 3 fields + size of wl_scan_params, not including variable length array */
-#define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
+#define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
 
 typedef struct wl_scan_results {
        u32 buflen;
@@ -282,7 +282,7 @@ typedef struct wl_escan_params {
        wl_scan_params_t params;
 } wl_escan_params_t;
 
-#define WL_ESCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
+#define WL_ESCAN_PARAMS_FIXED_SIZE (offsetof(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
 
 typedef struct wl_escan_result {
        u32 buflen;
@@ -302,7 +302,7 @@ typedef struct wl_iscan_results {
 
 /* size of wl_iscan_results not including variable length array */
 #define WL_ISCAN_RESULTS_FIXED_SIZE \
-       (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
+       (WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
 
 typedef struct wl_probe_params {
        wlc_ssid_t ssid;
@@ -490,7 +490,7 @@ typedef struct wl_rm_req {
        void *cb_arg;           /* arg to completion callback function */
        wl_rm_req_elt_t req[1]; /* variable length block of requests */
 } wl_rm_req_t;
-#define WL_RM_REQ_FIXED_LEN    OFFSETOF(wl_rm_req_t, req)
+#define WL_RM_REQ_FIXED_LEN    offsetof(wl_rm_req_t, req)
 
 typedef struct wl_rm_rep_elt {
        s8 type;
@@ -720,7 +720,7 @@ typedef struct {
        u32 rx_decrypt_failures;        /* # of packet decrypted unsuccessfully */
 } sta_info_t;
 
-#define WL_OLD_STAINFO_SIZE    OFFSETOF(sta_info_t, tx_pkts)
+#define WL_OLD_STAINFO_SIZE    offsetof(sta_info_t, tx_pkts)
 
 #define WL_STA_VER             3
 
@@ -1949,8 +1949,8 @@ typedef struct wl_pkt_filter {
        } u;
 } wl_pkt_filter_t;
 
-#define WL_PKT_FILTER_FIXED_LEN                  OFFSETOF(wl_pkt_filter_t, u)
-#define WL_PKT_FILTER_PATTERN_FIXED_LEN          OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
+#define WL_PKT_FILTER_FIXED_LEN                  offsetof(wl_pkt_filter_t, u)
+#define WL_PKT_FILTER_PATTERN_FIXED_LEN          offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
 
 /* IOVAR "pkt_filter_enable" parameter. */
 typedef struct wl_pkt_filter_enable {
@@ -1964,7 +1964,7 @@ typedef struct wl_pkt_filter_list {
        wl_pkt_filter_t filter[1];      /* Variable array of packet filters. */
 } wl_pkt_filter_list_t;
 
-#define WL_PKT_FILTER_LIST_FIXED_LEN     OFFSETOF(wl_pkt_filter_list_t, filter)
+#define WL_PKT_FILTER_LIST_FIXED_LEN     offsetof(wl_pkt_filter_list_t, filter)
 
 /* IOVAR "pkt_filter_stats" parameter. Used to retrieve debug statistics. */
 typedef struct wl_pkt_filter_stats {
index b695b75485bf429b974304d85361a1ad2ea8cfb0..26ff202fe0fe6e307661b0138d024d2eb4e8147f 100644 (file)
@@ -3339,12 +3339,12 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
 
                        }
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpiocontrol), ~0x0,
+                                  offsetof(chipcregs_t, gpiocontrol), ~0x0,
                                   0x0);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioout), 0x40, 0x40);
+                                  offsetof(chipcregs_t, gpioout), 0x40, 0x40);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioouten), 0x40,
+                                  offsetof(chipcregs_t, gpioouten), 0x40,
                                   0x40);
                } else {
                        mod_phy_reg(pi, 0x44c, (0x1 << 2), (0) << 2);
@@ -3352,11 +3352,11 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
                        mod_phy_reg(pi, 0x44d, (0x1 << 2), (0) << 2);
 
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioout), 0x40, 0x00);
+                                  offsetof(chipcregs_t, gpioout), 0x40, 0x00);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioouten), 0x40, 0x0);
+                                  offsetof(chipcregs_t, gpioouten), 0x40, 0x0);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpiocontrol), ~0x0,
+                                  offsetof(chipcregs_t, gpiocontrol), ~0x0,
                                   0x40);
                }
        }
index 46b728156bc57b9977217dc27ba787c23b00f4c2..0863a870403fccbb43e42530d457d606d2f0a4a3 100644 (file)
        (0 != (read_phy_reg((pi), 0x43b) & (0x1 << 6)))
 
 #define wlc_lcnphy_total_tx_frames(pi) \
-       wlapi_bmac_read_shm((pi)->sh->physhim, M_UCODE_MACSTAT + OFFSETOF(macstat_t, txallfrm))
+       wlapi_bmac_read_shm((pi)->sh->physhim, M_UCODE_MACSTAT + offsetof(macstat_t, txallfrm))
 
 typedef struct {
        u16 gm_gain;
index 3677dfedccf644fc6902f63150114694cb5cf98c..93df7840ed7f0888e228b893a0d909f22233d20e 100644 (file)
@@ -14549,7 +14549,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
                if ((pi->sh->boardflags & BFL_EXTLNA) &&
                    (CHSPEC_IS2G(pi->radio_chanspec))) {
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol), 0x40,
+                                  offsetof(chipcregs_t, chipcontrol), 0x40,
                                   0x40);
                }
        }
index e26c0534e3b12771a53c0371d59b061173f79624..2d1cf10c880ef7b8e1e5c39a7beee81a6388be13 100644 (file)
@@ -147,7 +147,7 @@ void wlc_bsscfg_mfree(osl_t *osh, wlc_bsscfg_t *cfg)
 
        if (cfg->maclist) {
                MFREE(osh, cfg->maclist,
-                     (int)(OFFSETOF(struct maclist, ea) +
+                     (int)(offsetof(struct maclist, ea) +
                            cfg->nmac * ETHER_ADDR_LEN));
                cfg->maclist = NULL;
        }
index 094ba2387cfa5507db7058ac3cd1a9f58e444916..8a2253647c6187ba3de860c6fbfbdc15129a66aa 100644 (file)
@@ -348,7 +348,7 @@ static int wlc_ffpld_check_txfunfl(wlc_info_t *wlc, int fid)
        /* return if we got here for a different reason than underflows */
        cur_txunfl =
            wlc_read_shm(wlc,
-                        M_UCODE_MACSTAT + OFFSETOF(macstat_t, txfunfl[fid]));
+                        M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid]));
        new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl);
        if (new_txunfl == 0) {
                WL_FFPLD(("check_txunfl : TX status FRAG set but no tx underflows\n"));
index 5e778966f7227b5ab5ceea39e17d11ecd187b062..33c03f40213a33b8d6c0b42ad11f5cbaaa124630 100644 (file)
@@ -2003,16 +2003,16 @@ void wlc_bmac_core_phypll_reset(wlc_hw_info_t *wlc_hw)
        WL_TRACE(("wl%d: wlc_bmac_core_phypll_reset\n", wlc_hw->unit));
 
        si_corereg(wlc_hw->sih, SI_CC_IDX,
-                  OFFSETOF(chipcregs_t, chipcontrol_addr), ~0, 0);
+                  offsetof(chipcregs_t, chipcontrol_addr), ~0, 0);
        OSL_DELAY(1);
        si_corereg(wlc_hw->sih, SI_CC_IDX,
-                  OFFSETOF(chipcregs_t, chipcontrol_data), 0x4, 0);
+                  offsetof(chipcregs_t, chipcontrol_data), 0x4, 0);
        OSL_DELAY(1);
        si_corereg(wlc_hw->sih, SI_CC_IDX,
-                  OFFSETOF(chipcregs_t, chipcontrol_data), 0x4, 4);
+                  offsetof(chipcregs_t, chipcontrol_data), 0x4, 4);
        OSL_DELAY(1);
        si_corereg(wlc_hw->sih, SI_CC_IDX,
-                  OFFSETOF(chipcregs_t, chipcontrol_data), 0x4, 0);
+                  offsetof(chipcregs_t, chipcontrol_data), 0x4, 0);
        OSL_DELAY(1);
 }
 
index 460587cb20a5ec94a939877e1f65c26b4a3acc3a..86eeeba2d969a7071e5afae6f29b8fa61be5d91e 100644 (file)
@@ -1791,9 +1791,9 @@ void *BCMATTACHFN(wlc_attach) (void *wl, u16 vendor, u16 device,
        ASSERT(sizeof(struct dot11_bcn_prb) == DOT11_BCN_PRB_LEN);
        ASSERT(sizeof(tx_status_t) == TXSTATUS_LEN);
        ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
-       ASSERT(OFFSETOF(wl_scan_params_t, channel_list) ==
+       ASSERT(offsetof(wl_scan_params_t, channel_list) ==
               WL_SCAN_PARAMS_FIXED_SIZE);
-       ASSERT(ISALIGNED(OFFSETOF(wsec_key_t, data), sizeof(u32)));
+       ASSERT(ISALIGNED(offsetof(wsec_key_t, data), sizeof(u32)));
        ASSERT(ISPOWEROF2(MA_WINDOW_SZ));
 
        ASSERT(sizeof(wlc_d11rxhdr_t) <= WL_HWRXOFF);
@@ -8123,7 +8123,7 @@ int wlc_get_revision_info(wlc_info_t *wlc, void *buf, uint len)
        rinfo->bus = wlc->pub->sih->bustype;
        rinfo->chipnum = wlc->pub->sih->chip;
 
-       if (len >= (OFFSETOF(wlc_rev_info_t, chippkg))) {
+       if (len >= (offsetof(wlc_rev_info_t, chippkg))) {
                rinfo->phytype = wlc->band->phytype;
                rinfo->phyrev = wlc->band->phyrev;
                rinfo->anarev = 0;      /* obsolete stuff, suppress */
index a79cbdd379cb16cd9d612125a12b9ef29fd0e127..df667c3daa917e5c546c899afdaea8b4ad5ed366 100644 (file)
@@ -198,7 +198,7 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len)
 
        /* pq is variable size; only zero out what's requested */
        bzero(pq,
-             OFFSETOF(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec));
+             offsetof(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec));
 
        pq->num_prec = (u16) num_prec;
 
index 1e954c7bd19a79dae0699427c4de0cfb7633f961..97daf1dab80a69c2ff30f111eeb63e8f6c8d6615 100644 (file)
@@ -71,34 +71,34 @@ static void si_pmu_set_4330_plldivs(si_t *sih);
 /* Read/write a chipcontrol reg */
 u32 si_pmu_chipcontrol(si_t *sih, uint reg, u32 mask, u32 val)
 {
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, chipcontrol_addr), ~0,
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, chipcontrol_addr), ~0,
                   reg);
        return si_corereg(sih, SI_CC_IDX,
-                         OFFSETOF(chipcregs_t, chipcontrol_data), mask, val);
+                         offsetof(chipcregs_t, chipcontrol_data), mask, val);
 }
 
 /* Read/write a regcontrol reg */
 u32 si_pmu_regcontrol(si_t *sih, uint reg, u32 mask, u32 val)
 {
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, regcontrol_addr), ~0,
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_addr), ~0,
                   reg);
        return si_corereg(sih, SI_CC_IDX,
-                         OFFSETOF(chipcregs_t, regcontrol_data), mask, val);
+                         offsetof(chipcregs_t, regcontrol_data), mask, val);
 }
 
 /* Read/write a pllcontrol reg */
 u32 si_pmu_pllcontrol(si_t *sih, uint reg, u32 mask, u32 val)
 {
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, pllcontrol_addr), ~0,
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, pllcontrol_addr), ~0,
                   reg);
        return si_corereg(sih, SI_CC_IDX,
-                         OFFSETOF(chipcregs_t, pllcontrol_data), mask, val);
+                         offsetof(chipcregs_t, pllcontrol_data), mask, val);
 }
 
 /* PMU PLL update */
 void si_pmu_pllupd(si_t *sih)
 {
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, pmucontrol),
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, pmucontrol),
                   PCTL_PLL_PLLCTL_UPD, PCTL_PLL_PLLCTL_UPD);
 }
 
@@ -176,9 +176,9 @@ BCMATTACHFN(si_pmu_set_ldo_voltage) (si_t *sih, osl_t *osh, u8 ldo,
 
        shift = sr_cntl_shift + rc_shift;
 
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, regcontrol_addr),
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_addr),
                   ~0, addr);
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, regcontrol_data),
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_data),
                   mask << shift, (voltage & mask) << shift);
 }
 
@@ -2532,7 +2532,7 @@ void BCMATTACHFN(si_pmu_chip_init) (si_t *sih, osl_t *osh)
        ASSERT(sih->cccaps & CC_CAP_PMU);
 
 #ifdef CHIPC_UART_ALWAYS_ON
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, clk_ctl_st),
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, clk_ctl_st),
                   CCS_FORCEALP, CCS_FORCEALP);
 #endif                         /* CHIPC_UART_ALWAYS_ON */
 
index 0a23a4c34f72e64c7b0855a635521b1d8a75ac09..f7ff1f60d1c5af347bf7325ad4726ecd60a9e739 100644 (file)
@@ -426,10 +426,10 @@ static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
        case SI_PCIDOWN:
                if (sih->buscorerev == 6) {     /* turn on serdes PLL down */
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol_addr), ~0,
+                                  offsetof(chipcregs_t, chipcontrol_addr), ~0,
                                   0);
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol_data),
+                                  offsetof(chipcregs_t, chipcontrol_data),
                                   ~0x40, 0);
                } else if (pi->pcie_pr42767) {
                        pcie_clkreq((void *)pi, 1, 1);
@@ -438,10 +438,10 @@ static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
        case SI_PCIUP:
                if (sih->buscorerev == 6) {     /* turn off serdes PLL down */
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol_addr), ~0,
+                                  offsetof(chipcregs_t, chipcontrol_addr), ~0,
                                   0);
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol_data),
+                                  offsetof(chipcregs_t, chipcontrol_data),
                                   ~0x40, 0x40);
                } else if (PCIE_ASPM(sih)) {    /* disable clkreq */
                        pcie_clkreq((void *)pi, 1, 0);
@@ -569,7 +569,7 @@ static void pcie_war_noplldown(pcicore_info_t *pi)
        ASSERT(pi->sih->buscorerev == 7);
 
        /* turn off serdes PLL down */
-       si_corereg(pi->sih, SI_CC_IDX, OFFSETOF(chipcregs_t, chipcontrol),
+       si_corereg(pi->sih, SI_CC_IDX, offsetof(chipcregs_t, chipcontrol),
                   CHIPCTRL_4321_PLL_DOWN, CHIPCTRL_4321_PLL_DOWN);
 
        /*  clear srom shadow backdoor */
index 4a0212fced1466323d2c774ec06918db5be55048..7dd627d32f96485c2e2e980d2623801d64ae0dd6 100644 (file)
@@ -486,7 +486,7 @@ static si_info_t *BCMATTACHFN(si_doattach) (si_info_t *sii, uint devid,
        w = getintvar(pvars, "leddc");
        if (w == 0)
                w = DEFAULT_GPIOTIMERVAL;
-       sb_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, gpiotimerval), ~0, w);
+       sb_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, gpiotimerval), ~0, w);
 
 #ifdef BCMDBG
        /* clear any previous epidiag-induced target abort */
@@ -646,7 +646,7 @@ static si_info_t *BCMATTACHFN(si_doattach) (si_info_t *sii, uint devid,
        w = getintvar(pvars, "leddc");
        if (w == 0)
                w = DEFAULT_GPIOTIMERVAL;
-       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, gpiotimerval), ~0, w);
+       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, gpiotimerval), ~0, w);
 
        if (PCIE(sii)) {
                ASSERT(sii->pch != NULL);
@@ -659,7 +659,7 @@ static si_info_t *BCMATTACHFN(si_doattach) (si_info_t *sii, uint devid,
                if (CHIPREV(sih->chiprev) == 0) {
                        SI_MSG(("Applying 43224A0 WARs\n"));
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, chipcontrol),
+                                  offsetof(chipcregs_t, chipcontrol),
                                   CCTRL43224_GPIO_TOGGLE,
                                   CCTRL43224_GPIO_TOGGLE);
                        si_pmu_chipcontrol(sih, 0, CCTRL_43224A0_12MA_LED_DRIVE,
@@ -1021,7 +1021,7 @@ si_watchdog(si_t *sih, uint ticks)
 
                if ((sih->chip == BCM4319_CHIP_ID) && (sih->chiprev == 0) &&
                        (ticks != 0)) {
-                       si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t,
+                       si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t,
                        clk_ctl_st), ~0, 0x2);
                        si_setcore(sih, USB20D_CORE_ID, 0);
                        si_core_disable(sih, 1);
@@ -1030,11 +1030,11 @@ si_watchdog(si_t *sih, uint ticks)
 
                if (ticks == 1)
                        ticks = 2;
-               si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, pmuwatchdog),
+               si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, pmuwatchdog),
                        ~0, ticks);
        } else {
                /* instant NMI */
-               si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, watchdog),
+               si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, watchdog),
                        ~0, ticks);
        }
 }
@@ -1048,7 +1048,7 @@ void si_watchdog(si_t *sih, uint ticks)
                if ((CHIPID(sih->chip) == BCM4319_CHIP_ID) &&
                    (CHIPREV(sih->chiprev) == 0) && (ticks != 0)) {
                        si_corereg(sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, clk_ctl_st), ~0, 0x2);
+                                  offsetof(chipcregs_t, clk_ctl_st), ~0, 0x2);
                        si_setcore(sih, USB20D_CORE_ID, 0);
                        si_core_disable(sih, 1);
                        si_setcore(sih, CC_CORE_ID, 0);
@@ -1068,7 +1068,7 @@ void si_watchdog(si_t *sih, uint ticks)
                else if (ticks > maxt)
                        ticks = maxt;
 
-               si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, pmuwatchdog),
+               si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, pmuwatchdog),
                           ~0, ticks);
        } else {
                /* make sure we come up in fast clock mode; or if clearing, clear clock */
@@ -1077,7 +1077,7 @@ void si_watchdog(si_t *sih, uint ticks)
                if (ticks > maxt)
                        ticks = maxt;
 
-               si_corereg(sih, SI_CC_IDX, OFFSETOF(chipcregs_t, watchdog), ~0,
+               si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, watchdog), ~0,
                           ticks);
        }
 }
@@ -1786,7 +1786,7 @@ u32 si_gpiocontrol(si_t *sih, u32 mask, u32 val, u8 priority)
                val &= mask;
        }
 
-       regoff = OFFSETOF(chipcregs_t, gpiocontrol);
+       regoff = offsetof(chipcregs_t, gpiocontrol);
        return si_corereg(sih, SI_CC_IDX, regoff, mask, val);
 }