Module Name: src
Committed By: nonaka
Date: Mon Feb 16 13:22:19 UTC 2015
Modified Files:
src/sys/dev/pci: if_iwm.c if_iwmreg.h if_iwmvar.h
Log Message:
whitespace
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_iwm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_iwmreg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_iwmvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.7 src/sys/dev/pci/if_iwm.c:1.8
--- src/sys/dev/pci/if_iwm.c:1.7 Mon Feb 16 13:16:00 2015
+++ src/sys/dev/pci/if_iwm.c Mon Feb 16 13:22:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $ */
+/* $NetBSD: if_iwm.c,v 1.8 2015/02/16 13:22:19 nonaka Exp $ */
/* OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp */
/*
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.8 2015/02/16 13:22:19 nonaka Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -222,7 +222,7 @@ static int iwm_poll_bit(struct iwm_softc
static int iwm_nic_lock(struct iwm_softc *);
static void iwm_nic_unlock(struct iwm_softc *);
static void iwm_set_bits_mask_prph(struct iwm_softc *, uint32_t, uint32_t,
- uint32_t);
+ uint32_t);
static void iwm_set_bits_prph(struct iwm_softc *, uint32_t, uint32_t);
static void iwm_clear_bits_prph(struct iwm_softc *, uint32_t, uint32_t);
static int iwm_dma_contig_alloc(bus_dma_tag_t, struct iwm_dma_info *,
@@ -614,8 +614,8 @@ static int
iwm_read_firmware(struct iwm_softc *sc)
{
struct iwm_fw_info *fw = &sc->sc_fw;
- struct iwm_tlv_ucode_header *uhdr;
- struct iwm_ucode_tlv tlv;
+ struct iwm_tlv_ucode_header *uhdr;
+ struct iwm_ucode_tlv tlv;
enum iwm_ucode_tlv_type tlv_type;
uint8_t *data;
int error, status;
@@ -1296,7 +1296,7 @@ iwm_check_rfkill(struct iwm_softc *sc)
uint32_t v;
int s;
int rv;
-
+
s = splnet();
/*
@@ -1376,7 +1376,7 @@ iwm_set_hw_ready(struct iwm_softc *sc)
IWM_SETBITS(sc, IWM_CSR_HW_IF_CONFIG_REG,
IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY);
- return iwm_poll_bit(sc, IWM_CSR_HW_IF_CONFIG_REG,
+ return iwm_poll_bit(sc, IWM_CSR_HW_IF_CONFIG_REG,
IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
IWM_HW_READY_TIMEOUT);
@@ -1556,7 +1556,7 @@ iwm_start_hw(struct iwm_softc *sc)
if ((error = iwm_prepare_card_hw(sc)) != 0)
return error;
- /* Reset the entire device */
+ /* Reset the entire device */
IWM_WRITE(sc, IWM_CSR_RESET,
IWM_CSR_RESET_REG_FLAG_SW_RESET |
IWM_CSR_RESET_REG_FLAG_NEVO_RESET);
@@ -1627,9 +1627,9 @@ iwm_stop_device(struct iwm_softc *sc)
/* Stop the device, and put it in low power state */
iwm_apm_stop(sc);
- /* Upon stop, the APM issues an interrupt if HW RF kill is set.
- * Clean again the interrupt here
- */
+ /* Upon stop, the APM issues an interrupt if HW RF kill is set.
+ * Clean again the interrupt here
+ */
iwm_disable_interrupts(sc);
/* stop and reset the on-board processor */
IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_NEVO_RESET);
@@ -1677,8 +1677,8 @@ iwm_mvm_nic_config(struct iwm_softc *sc)
IWM_WRITE(sc, IWM_CSR_HW_IF_CONFIG_REG, reg_val);
- DPRINTF(("Radio type=0x%x-0x%x-0x%x\n", radio_cfg_type,
- radio_cfg_step, radio_cfg_dash));
+ DPRINTF(("Radio type=0x%x-0x%x-0x%x\n", radio_cfg_type,
+ radio_cfg_step, radio_cfg_dash));
/*
* W/A : NIC is stuck in a reset state after Early PCIe power off
@@ -1797,7 +1797,7 @@ iwm_nic_init(struct iwm_softc *sc)
DPRINTF(("shadow registers enabled\n"));
IWM_SETBITS(sc, IWM_CSR_MAC_SHADOW_REG_CTRL, 0x800fffff);
- return 0;
+ return 0;
}
#if 0
@@ -1810,10 +1810,10 @@ enum iwm_mvm_tx_fifo {
};
static const uint8_t iwm_mvm_ac_to_tx_fifo[] = {
- IWM_MVM_TX_FIFO_VO,
- IWM_MVM_TX_FIFO_VI,
- IWM_MVM_TX_FIFO_BE,
- IWM_MVM_TX_FIFO_BK,
+ IWM_MVM_TX_FIFO_VO,
+ IWM_MVM_TX_FIFO_VI,
+ IWM_MVM_TX_FIFO_BE,
+ IWM_MVM_TX_FIFO_BK,
};
#endif
@@ -1907,7 +1907,7 @@ iwm_post_alive(struct iwm_softc *sc)
IWM_SETBITS(sc, IWM_FH_TX_CHICKEN_BITS_REG,
IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN);
- /* Enable L1-Active */
+ /* Enable L1-Active */
iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG,
IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
@@ -2665,8 +2665,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc,
*/
struct iwm_nvm_section {
- uint16_t length;
- const uint8_t *data;
+ uint16_t length;
+ const uint8_t *data;
};
#define IWM_FW_VALID_TX_ANT(sc) \
@@ -2757,7 +2757,7 @@ iwm_firmware_load_chunk(struct iwm_softc
IWM_WRITE(sc, IWM_FH_TFDIB_CTRL0_REG(IWM_FH_SRVC_CHNL),
dma->paddr & IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK);
IWM_WRITE(sc, IWM_FH_TFDIB_CTRL1_REG(IWM_FH_SRVC_CHNL),
- (iwm_get_dma_hi_addr(dma->paddr)
+ (iwm_get_dma_hi_addr(dma->paddr)
<< IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt);
IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_BUF_STS_REG(IWM_FH_SRVC_CHNL),
1 << IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM |
@@ -2767,7 +2767,7 @@ iwm_firmware_load_chunk(struct iwm_softc
IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE |
IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE |
IWM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_ENDTFD);
-
+
iwm_nic_unlock(sc);
/* wait 1s for this segment to load */
@@ -2775,7 +2775,7 @@ iwm_firmware_load_chunk(struct iwm_softc
if ((error = tsleep(&sc->sc_fw, 0, "iwmfw", hz)) != 0)
break;
- return error;
+ return error;
}
static int
@@ -2897,7 +2897,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm
return error;
sc->sc_uc_current = ucode_type;
- error = iwm_start_fw(sc, ucode_type);
+ error = iwm_start_fw(sc, ucode_type);
if (error) {
sc->sc_uc_current = old_type;
return error;
@@ -2926,7 +2926,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc
}
sc->sc_init_complete = 0;
- if ((error = iwm_mvm_load_ucode_wait_alive(sc,
+ if ((error = iwm_mvm_load_ucode_wait_alive(sc,
IWM_UCODE_TYPE_INIT)) != 0)
return error;
@@ -3018,7 +3018,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int
data->m = m;
bus_dmamap_sync(sc->sc_dmat, data->map, 0, size, BUS_DMASYNC_PREREAD);
- /* Update RX descriptor. */
+ /* Update RX descriptor. */
ring->desc[idx] = htole32(data->map->dm_segs[0].ds_addr >> 8);
bus_dmamap_sync(sc->sc_dmat, ring->desc_dma.map,
idx * sizeof(uint32_t), sizeof(uint32_t), BUS_DMASYNC_PREWRITE);
@@ -3261,7 +3261,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_soft
}
static void
-iwm_mvm_rx_tx_cmd(struct iwm_softc *sc,
+iwm_mvm_rx_tx_cmd(struct iwm_softc *sc,
struct iwm_rx_packet *pkt, struct iwm_rx_data *data)
{
struct ieee80211com *ic = &sc->sc_ic;
@@ -3480,7 +3480,7 @@ iwm_mvm_phy_ctxt_changed(struct iwm_soft
chains_static, chains_dynamic, IWM_FW_CTXT_ACTION_MODIFY, 0);
}
-/*
+/*
* END iwlwifi/mvm/phy-ctxt.c
*/
@@ -3816,7 +3816,7 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, st
} else {
tx->initial_rate_index = (nrates-1) - in->in_ni.ni_txrate;
}
- tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE);
+ tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE);
DPRINTFN(12, ("start with txrate %d\n", tx->initial_rate_index));
return &iwm_rates[tx->initial_rate_index];
}
@@ -3941,12 +3941,12 @@ iwm_tx(struct iwm_softc *sc, struct mbuf
tx->pm_frame_timeout = htole16(0);
}
- if (hdrlen & 3) {
- /* First segment length must be a multiple of 4. */
- flags |= IWM_TX_CMD_FLG_MH_PAD;
- pad = 4 - (hdrlen & 3);
- } else
- pad = 0;
+ if (hdrlen & 3) {
+ /* First segment length must be a multiple of 4. */
+ flags |= IWM_TX_CMD_FLG_MH_PAD;
+ pad = 4 - (hdrlen & 3);
+ } else
+ pad = 0;
tx->driver_txop = 0;
tx->next_frame_len = 0;
@@ -5180,7 +5180,7 @@ iwm_auth(struct iwm_softc *sc)
while (sc->sc_auth_prot)
tsleep(&sc->sc_auth_prot, 0, "iwmauth", 0);
sc->sc_auth_prot = 1;
-
+
duration = min(IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS,
200 + in->in_ni.ni_intval);
min_duration = min(IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS,
@@ -5334,7 +5334,7 @@ iwm_setrates(struct iwm_node *in)
memset(&in->in_ridx, -1, sizeof(in->in_ridx));
for (i = 0; i < nrates; i++) {
int rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL;
-
+
/* Map 802.11 rate to HW rate index. */
for (ridx = 0; ridx <= IWM_RIDX_MAX; ridx++)
if (iwm_rates[ridx].rate == rate)
@@ -5489,7 +5489,7 @@ iwm_newstate_cb(struct work *wk, void *v
if ((error = iwm_mvm_scan_request(sc, IEEE80211_CHAN_2GHZ,
ic->ic_des_esslen != 0,
ic->ic_des_essid, ic->ic_des_esslen)) != 0) {
- DPRINTF(("%s: could not initiate scan\n", DEVNAME(sc)));
+ DPRINTF(("%s: could not initiate scan\n", DEVNAME(sc)));
return;
}
ic->ic_state = nstate;
@@ -5635,15 +5635,15 @@ iwm_init_hw(struct iwm_softc *sc)
goto error;
}
- if ((error = iwm_send_tx_ant_cfg(sc, IWM_FW_VALID_TX_ANT(sc))) != 0)
- goto error;
+ if ((error = iwm_send_tx_ant_cfg(sc, IWM_FW_VALID_TX_ANT(sc))) != 0)
+ goto error;
- /* Send phy db control command and then phy db calibration*/
- if ((error = iwm_send_phy_db_data(sc)) != 0)
- goto error;
+ /* Send phy db control command and then phy db calibration*/
+ if ((error = iwm_send_phy_db_data(sc)) != 0)
+ goto error;
- if ((error = iwm_send_phy_cfg_cmd(sc)) != 0)
- goto error;
+ if ((error = iwm_send_phy_cfg_cmd(sc)) != 0)
+ goto error;
/* Add auxiliary station for scanning */
if ((error = iwm_mvm_add_aux_sta(sc)) != 0)
@@ -5660,9 +5660,9 @@ iwm_init_hw(struct iwm_softc *sc)
goto error;
}
- error = iwm_mvm_power_update_device(sc);
- if (error)
- goto error;
+ error = iwm_mvm_power_update_device(sc);
+ if (error)
+ goto error;
/* Mark TX rings as active. */
for (qid = 0; qid < 4; qid++) {
@@ -5720,7 +5720,7 @@ iwm_start(struct ifnet *ifp)
struct iwm_softc *sc = ifp->if_softc;
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_node *ni;
- struct ether_header *eh;
+ struct ether_header *eh;
struct mbuf *m;
int ac;
@@ -5748,11 +5748,11 @@ iwm_start(struct ifnet *ifp)
IFQ_DEQUEUE(&ifp->if_snd, m);
if (!m)
break;
- if (m->m_len < sizeof (*eh) &&
- (m = m_pullup(m, sizeof (*eh))) == NULL) {
- ifp->if_oerrors++;
- continue;
- }
+ if (m->m_len < sizeof (*eh) &&
+ (m = m_pullup(m, sizeof (*eh))) == NULL) {
+ ifp->if_oerrors++;
+ continue;
+ }
if (ifp->if_bpf != NULL)
bpf_mtap(ifp, m);
@@ -6246,7 +6246,7 @@ iwm_notif_intr(struct iwm_softc *sc)
case IWM_TIME_EVENT_NOTIFICATION: {
struct iwm_time_event_notif *notif;
SYNC_RESP_STRUCT(notif, pkt);
-
+
if (notif->status) {
if (le32toh(notif->action) &
IWM_TE_V2_NOTIF_HOST_EVENT_START)
@@ -6515,7 +6515,7 @@ iwm_attach_hook(device_t dev)
IWM_UCODE_MINOR(sc->sc_fwver),
IWM_UCODE_API(sc->sc_fwver),
ether_sprintf(sc->sc_nvm.hw_addr));
-
+
ic->ic_ifp = ifp;
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
@@ -6782,12 +6782,12 @@ iwm_init_task(void *arg1)
struct iwm_softc *sc = arg1;
struct ifnet *ifp = &sc->sc_ic.ic_if;
int s;
-
+
s = splnet();
while (sc->sc_flags & IWM_FLAG_BUSY)
tsleep(&sc->sc_flags, 0, "iwmpwr", 0);
sc->sc_flags |= IWM_FLAG_BUSY;
-
+
iwm_stop(ifp, 0);
if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_UP)
iwm_init(ifp);
Index: src/sys/dev/pci/if_iwmreg.h
diff -u src/sys/dev/pci/if_iwmreg.h:1.1 src/sys/dev/pci/if_iwmreg.h:1.2
--- src/sys/dev/pci/if_iwmreg.h:1.1 Sat Feb 7 13:20:00 2015
+++ src/sys/dev/pci/if_iwmreg.h Mon Feb 16 13:22:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwmreg.h,v 1.1 2015/02/07 13:20:00 pooka Exp $ */
+/* $NetBSD: if_iwmreg.h,v 1.2 2015/02/16 13:22:19 nonaka Exp $ */
/* OpenBSD: if_iwmreg.h,v 1.2 2015/02/06 23:52:23 stsp Exp */
/******************************************************************************
@@ -5232,9 +5232,9 @@ struct iwm_cmd_header {
} __packed;
enum iwm_power_scheme {
- IWM_POWER_SCHEME_CAM = 1,
- IWM_POWER_SCHEME_BPS,
- IWM_POWER_SCHEME_LP
+ IWM_POWER_SCHEME_CAM = 1,
+ IWM_POWER_SCHEME_BPS,
+ IWM_POWER_SCHEME_LP
};
#define IWM_DEF_CMD_PAYLOAD_SIZE 320
@@ -5247,19 +5247,19 @@ struct iwm_device_cmd {
} __packed;
struct iwm_rx_packet {
- /*
- * The first 4 bytes of the RX frame header contain both the RX frame
- * size and some flags.
- * Bit fields:
- * 31: flag flush RB request
- * 30: flag ignore TC (terminal counter) request
- * 29: flag fast IRQ request
- * 28-14: Reserved
- * 13-00: RX frame size
- */
- uint32_t len_n_flags;
- struct iwm_cmd_header hdr;
- uint8_t data[];
+ /*
+ * The first 4 bytes of the RX frame header contain both the RX frame
+ * size and some flags.
+ * Bit fields:
+ * 31: flag flush RB request
+ * 30: flag ignore TC (terminal counter) request
+ * 29: flag fast IRQ request
+ * 28-14: Reserved
+ * 13-00: RX frame size
+ */
+ uint32_t len_n_flags;
+ struct iwm_cmd_header hdr;
+ uint8_t data[];
} __packed;
#define IWM_FH_RSCSR_FRAME_SIZE_MSK 0x00003fff
@@ -5268,14 +5268,14 @@ static uint32_t
iwm_rx_packet_len(const struct iwm_rx_packet *pkt)
{
- return le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK;
+ return le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK;
}
static uint32_t
iwm_rx_packet_payload_len(const struct iwm_rx_packet *pkt)
{
- return iwm_rx_packet_len(pkt) - sizeof(pkt->hdr);
+ return iwm_rx_packet_len(pkt) - sizeof(pkt->hdr);
}
Index: src/sys/dev/pci/if_iwmvar.h
diff -u src/sys/dev/pci/if_iwmvar.h:1.3 src/sys/dev/pci/if_iwmvar.h:1.4
--- src/sys/dev/pci/if_iwmvar.h:1.3 Fri Feb 13 18:57:47 2015
+++ src/sys/dev/pci/if_iwmvar.h Mon Feb 16 13:22:19 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwmvar.h,v 1.3 2015/02/13 18:57:47 nonaka Exp $ */
+/* $NetBSD: if_iwmvar.h,v 1.4 2015/02/16 13:22:19 nonaka Exp $ */
/* OpenBSD: if_iwmvar.h,v 1.3 2015/02/07 07:10:44 phessler Exp */
/*
@@ -167,7 +167,7 @@ struct iwm_fw_info {
struct iwm_fw_onesect {
void *fws_data;
uint32_t fws_len;
- uint32_t fws_devoff;
+ uint32_t fws_devoff;
void *fws_alloc;
size_t fws_allocsize;
@@ -297,7 +297,7 @@ struct iwm_rx_ring {
struct iwm_ucode_status {
uint32_t uc_error_event_table;
uint32_t uc_log_event_table;
-
+
int uc_ok;
int uc_intr;
};
@@ -321,8 +321,8 @@ enum IWM_CMD_MODE {
IWM_CMD_SEND_IN_RFKILL = (1 << 2),
};
enum iwm_hcmd_dataflag {
- IWM_HCMD_DFL_NOCOPY = (1 << 0),
- IWM_HCMD_DFL_DUP = (1 << 1),
+ IWM_HCMD_DFL_NOCOPY = (1 << 0),
+ IWM_HCMD_DFL_DUP = (1 << 1),
};
/*
@@ -388,14 +388,14 @@ struct iwm_softc {
struct iwm_dma_info sched_dma;
uint32_t sched_base;
- /* TX/RX rings. */
+ /* TX/RX rings. */
struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES];
struct iwm_rx_ring rxq;
int qfullmsk;
int sc_sf_state;
- /* ICT table. */
+ /* ICT table. */
struct iwm_dma_info ict_dma;
int ict_cur;