Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220243
b: refs/heads/master
c: ce0f1b8
h: refs/heads/master
i:
  220241: bd72cb1
  220239: d186c34
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 8, 2010
1 parent d4af91b commit 11f2299
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 64 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: 3ea2f4d640479a40847e311282ee73695b6e82cf
refs/heads/master: ce0f1b8cd1526e800b8f3c1e978ac7c23ed91e2f
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/brcmfmac/bcmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/wl_iw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/staging/brcm80211/include/bcmutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/staging/brcm80211/include/wlioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3339,24 +3339,24 @@ 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);

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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
(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;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/phy/wlc_phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/sys/wlc_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/sys/wlc_ampdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/brcm80211/sys/wlc_bmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/brcm80211/sys/wlc_mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/brcm80211/util/bcmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/staging/brcm80211/util/hndpmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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 */

Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/staging/brcm80211/util/nicpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down
Loading

0 comments on commit 11f2299

Please sign in to comment.