drivers/wireless/ieee80211: Used nxstyle to find coding standard violations, then corrected them.

This commit is contained in:
Gregory Nutt 2018-08-22 17:35:17 -06:00
parent a465b6f0d4
commit 1f1ead3099
5 changed files with 41 additions and 23 deletions

View File

@ -91,7 +91,10 @@ struct __attribute__((packed)) bcmf_event_msg
* Private Data
****************************************************************************/
static const uint8_t bcmf_broadcom_oui[] = {0x00, 0x10, 0x18};
static const uint8_t bcmf_broadcom_oui[] =
{
0x00, 0x10, 0x18
};
/****************************************************************************
* Public Functions
@ -103,8 +106,8 @@ struct bcmf_frame_s *bcmf_bdc_allocate_frame(FAR struct bcmf_dev_s *priv,
struct bcmf_frame_s *frame;
/* Allocate data frame */
/* TODO check for integer overflow */
// TODO check for integer overflow
frame = priv->bus->allocate_frame(priv,
sizeof(struct bcmf_bdc_header) + len, block, false);
@ -245,7 +248,7 @@ int bcmf_bdc_transmit_frame(FAR struct bcmf_dev_s *priv,
/* Setup data frame header */
header->flags = 0x20; /* Set bdc protocol version */
header->priority = 0; // TODO handle priority
header->priority = 0; /* TODO handle priority */
header->flags2 = CHIP_STA_INTERFACE;
header->data_offset = 0;
@ -280,7 +283,7 @@ struct bcmf_frame_s *bcmf_bdc_rx_frame(FAR struct bcmf_dev_s *priv)
/* Transmit frame to upper layer */
header = (struct bcmf_bdc_header*)frame->data;
header = (struct bcmf_bdc_header *)frame->data;
frame->data += sizeof(struct bcmf_bdc_header) + header->data_offset * 4;
return frame;
}

View File

@ -300,7 +300,7 @@ int bcmf_cdc_process_control_frame(FAR struct bcmf_dev_s *priv,
return -EINVAL;
}
// TODO check interface ?
/* TODO check interface ? */
if (cdc_header->flags >> BCMF_CONTROL_REQID_SHIFT == priv->control_reqid)
{

View File

@ -65,8 +65,7 @@ const struct bcmf_sdio_chip bcmf_43362_config_sdio =
},
/* Firmware images */
// TODO find something smarter than using image_len references
/* TODO find something smarter than using image_len references */
.firmware_image = (uint8_t *)bcm43362_firmware_image,
.firmware_image_size = (unsigned int *)&bcm43362_firmware_image_len,

View File

@ -133,7 +133,7 @@ FAR struct bcmf_dev_s *g_sdio_priv;
static struct bcmf_sdio_frame g_pktframes[BCMF_PKT_POOL_SIZE];
// TODO free_queue should be static
/* TODO free_queue should be static */
/****************************************************************************
* Private Functions
@ -521,7 +521,7 @@ static int bcmf_sdio_sr_init(FAR struct bcmf_sdio_dev_s *sbus)
/* Enable KeepSdioOn (KSO) bit for normal operation */
bcmf_read_reg(sbus, 1, SBSDIO_FUNC1_SLEEPCSR, &data);
if((data & SBSDIO_FUNC1_SLEEPCSR_KSO_MASK) == 0)
if ((data & SBSDIO_FUNC1_SLEEPCSR_KSO_MASK) == 0)
{
data |= SBSDIO_FUNC1_SLEEPCSR_KSO_MASK;
bcmf_write_reg(sbus, 1, SBSDIO_FUNC1_SLEEPCSR, data);
@ -660,7 +660,7 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
sbus->bus.rxframe = bcmf_sdpcm_get_rx_frame;
sbus->bus.allocate_frame = bcmf_sdpcm_alloc_frame;
sbus->bus.free_frame = bcmf_sdpcm_free_frame;
sbus->bus.stop = NULL; // TODO
sbus->bus.stop = NULL; /* TODO */
/* Init transmit frames queue */
@ -674,7 +674,7 @@ int bcmf_bus_sdio_initialize(FAR struct bcmf_dev_s *priv,
sq_init(&sbus->free_queue);
/* Setup free buffer list */
// FIXME this should be static to driver
/* FIXME this should be static to driver */
for (ret = 0; ret < BCMF_PKT_POOL_SIZE; ret++)
{
@ -923,8 +923,11 @@ int bcmf_sdio_thread(int argc, char **argv)
/* If we're done for now, turn off clock request. */
// TODO add wakelock
// bcmf_sdio_bus_sleep(sbus, true);
#if 0
/* TODO add wakelock */
bcmf_sdio_bus_sleep(sbus, true);
#endif
}
wlinfo("Exit\n");
@ -945,7 +948,9 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR struct bcmf_dev_s *priv,
PANIC();
}
// if (!tx || sbus->tx_queue_count < BCMF_PKT_POOL_SIZE-1)
#if 0
if (!tx || sbus->tx_queue_count < BCMF_PKT_POOL_SIZE-1)
#endif
{
if ((entry = bcmf_dqueue_pop_tail(&sbus->free_queue)) != NULL)
{
@ -963,7 +968,7 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR struct bcmf_dev_s *priv,
if (block)
{
// TODO use signaling semaphore
/* TODO use signaling semaphore */
wlinfo("alloc failed %d\n", tx);
up_mdelay(100);

View File

@ -210,8 +210,11 @@ int bcmf_sdpcm_readframe(FAR struct bcmf_dev_s *priv)
goto exit_abort;
}
// wlinfo("Receive frame %p %d\n", sframe, len);
// bcmf_hexdump((uint8_t *)header, header->size, (unsigned int)header);
#if 0
wlinfo("Receive frame %p %d\n", sframe, len);
bcmf_hexdump((uint8_t *)header, header->size, (unsigned int)header);
#endif
/* Process and validate header */
@ -301,7 +304,8 @@ int bcmf_sdpcm_sendframe(FAR struct bcmf_dev_s *priv)
if (sbus->tx_seq == sbus->max_seq)
{
// TODO handle this case
/* TODO handle this case */
wlerr("No credit to send frame\n");
return -EAGAIN;
}
@ -320,18 +324,22 @@ int bcmf_sdpcm_sendframe(FAR struct bcmf_dev_s *priv)
header->sequence = sbus->tx_seq++;
// wlinfo("Send frame %p\n", sframe);
// bcmf_hexdump(sframe->header.base, sframe->header.len,
// (unsigned long)sframe->header.base);
#if 0
wlinfo("Send frame %p\n", sframe);
bcmf_hexdump(sframe->header.base, sframe->header.len,
(unsigned long)sframe->header.base);
#endif
ret = bcmf_transfer_bytes(sbus, true, 2, 0, sframe->header.base,
sframe->header.len);
if (ret != OK)
{
/* TODO handle retry count and remove frame from queue + abort TX */
wlinfo("fail send frame %d\n", ret);
ret = -EIO;
goto exit_abort;
// TODO handle retry count and remove frame from queue + abort TX
}
/* Frame sent, remove it from queue */
@ -354,7 +362,10 @@ int bcmf_sdpcm_sendframe(FAR struct bcmf_dev_s *priv)
return OK;
exit_abort:
// bcmf_sdpcm_txfail(sbus, false);
#if 0
bcmf_sdpcm_txfail(sbus, false);
#endif
nxsem_post(&sbus->queue_mutex);
return ret;
}