Fix dangling white space at the end of lines.

This commit is contained in:
Gregory Nutt 2017-07-03 10:08:49 -06:00
parent dd2ca20bad
commit 053b6e3d9f
5 changed files with 43 additions and 501 deletions

View File

@ -993,226 +993,116 @@ static int at86rf23x_gettxpower(FAR struct ieee802154_radio_s *ieee,
/* Right now we only get negative values */ /* Right now we only get negative values */
reg = at86rf23x_getreg(dev->spi, RF23X_REG_TXPWR); reg = at86rf23x_getreg(dev->spi, RF23X_REG_TXPWR);
switch (reg) switch (reg)
{ {
case RF23X_TXPWR_POS_4: case RF23X_TXPWR_POS_4:
*txpwr = 0; *txpwr = 0;
break; break;
case RF23X_TXPWR_POS_3_7:
*txpwr =0;
case RF23X_TXPWR_POS_3_7:
*txpwr =
0;
break; break;
case RF23X_TXPWR_POS_3_4:
case RF23X_TXPWR_POS_3_4:
*txpwr = 0; *txpwr = 0;
break; break;
case RF23X_TXPWR_POS_3: case RF23X_TXPWR_POS_3:
*txpwr = *txpwr = 0;
0;
break; break;
case RF23X_TXPWR_POS_2_5:
case RF23X_
TXPWR_POS_2_5:
*txpwr = 0; *txpwr = 0;
break; break;
case RF23X_TXPWR_POS_2:
case RF23X_TXPWR_POS_2:
*txpwr = 0; *txpwr = 0;
break; break;
case RF23X_TXPWR_POS_1: case RF23X_TXPWR_POS_1:
*txpwr = 0; *txpwr = 0;
break; break;
case RF23X_TXPWR_0:
*txpwr =0;
case RF23X_TXPWR_0:
*txpwr =
0;
break; break;
case RF23X_TXPWR_NEG_1:
case RF23X_TXPWR_NEG_1:
*txpwr = 1000; *txpwr = 1000;
break; break;
case RF23X_TXPWR_NEG_2:
case RF23X_TXPWR_NE
G_2:
*txpwr = 2000; *txpwr = 2000;
break; break;
case RF23X_TXPWR_NEG_3: case RF23X_TXPWR_NEG_3:
*txpwr = 3000;
*txpwr = 3000;
break; break;
case RF23X_TXPWR_NEG_4: case RF23X_TXPWR_NEG_4:
*txpwr = 4000;
break;
*txpwr = 4000;
break;
case RF23X_TXPWR_NEG_6: case RF23X_TXPWR_NEG_6:
*txpwr = 6000; *txpwr = 6000;
break; break;
case RF23X_TXPWR_NEG_8: case RF23X_TXPWR_NEG_8:
*txpwr = 8000; *txpwr = 8000;
break; break;
case RF23X_TXPWR_NEG_12:
ca
se RF23X_TXPWR_NEG_12:
*txpwr = 12000; *txpwr = 12000;
break; break;
case RF23X_TXPWR_NEG_17: case RF23X_TXPWR_NEG_17:
*txpwr = 17000;
*txpwr = 17 break;
000;
break;
} }
return OK; return OK;
} }
/****************************************************************************
/****
************************************************************************
* Name: at86rf23x_setcca * Name: at86rf23x_setcca
* *
* Description: * Description:
* Configures if energy detection is used or carrier sense. The base * Configures if energy detection is used or carrier sense. The base
* measurement is configured here as well * measurement is configured here as well
* *
****************************************************************************/
*
*************************************************************************
***/
static static
int at86rf23x_setcca(FAR struct ieee802154_radio_s *ieee, int at86rf23x_setcca(FAR struct ieee802154_radio_s *ieee,
FAR struct ieee802154_cca_s *cca)
FAR struct ieee802154_cca_s *cca)
{ {
FAR struct at86rf23x_dev_s *dev = (struct at86rf23x_dev_s *)ieee; FAR struct at86rf23x_dev_s *dev = (struct at86rf23x_dev_s *)ieee;
/* TODO: This doesn't fit the RF233 completely come back to this */ /* TODO: This doesn't fit the RF233 completely come back to this */
if (!cca->use_ed && !cca->use_cs) if (!cca->use_ed && !cca->use_cs)
{ {
return -EINVAL; return -EINVAL;
} }
if (cca->use_cs && cca->csth > 0x0f) if (cca->use_cs && cca->csth > 0x0f)
{ {
return -EINVAL; return -EINVAL;
} }
if (cca->use_ed) if (cca->use_ed)
{
{
at86rf23x_setregbits(dev->spi, RF23X_CCA_BITS_MODE, RF23X_CCA_MODE_ED); at86rf23x_setregbits(dev->spi, RF23X_CCA_BITS_MODE, RF23X_CCA_MODE_ED);
} }
if (cca->use_cs)
if (cca->use_cs)
{ {
at86rf23x_setregbits(dev->spi, RF23X_CCA_BITS_MODE, RF23X_CCA_MODE_CS);
at86rf23x_setregbits(dev->spi, RF23X_CCA_BITS_MODE, RF23X_CCA
_MODE_CS);
} }
memcpy(&dev->cca, cca, sizeof(struct ieee802154_cca_s));
memcpy(&dev->cca, cca, sizeof(struct ieee802154
_cca_s));
return OK; return OK;
} }

View File

@ -465,7 +465,7 @@ static int mrf24j40_reset(FAR struct ieee802154_radio_s *radio)
/* Set this in reset since it can exist for all device modes. See pg 101 */ /* Set this in reset since it can exist for all device modes. See pg 101 */
mrf24j40_setreg(dev->spi, MRF24J40_FRMOFFSET, 0x15); mrf24j40_setreg(dev->spi, MRF24J40_FRMOFFSET, 0x15);
/* For now, we want to always just have the frame pending bit set when /* For now, we want to always just have the frame pending bit set when
* acknowledging a Data Request command. The standard says that the coordinator * acknowledging a Data Request command. The standard says that the coordinator
* can do this if it needs time to figure out whether it has data or not * can do this if it needs time to figure out whether it has data or not
@ -613,7 +613,7 @@ static int mrf24j40_setattr(FAR struct ieee802154_radio_s *radio,
} }
break; break;
case IEEE802154_ATTR_PHY_CHAN: case IEEE802154_ATTR_PHY_CHAN:
{ {
mrf24j40_setchannel(dev, attrval->phy.chan); mrf24j40_setchannel(dev, attrval->phy.chan);
@ -729,7 +729,7 @@ static int mrf24j40_sfupdate(FAR struct ieee802154_radio_s *radio,
mrf24j40_setorder(dev, sfspec->beaconorder, sfspec->sforder); mrf24j40_setorder(dev, sfspec->beaconorder, sfspec->sforder);
/* Program the CAP end slot (ESLOTG1 0x13<3:0>) value. */ /* Program the CAP end slot (ESLOTG1 0x13<3:0>) value. */
reg = mrf24j40_getreg(dev->spi, MRF24J40_ESLOTG1); reg = mrf24j40_getreg(dev->spi, MRF24J40_ESLOTG1);
reg &= ~MRF24J40_ESLOTG1_CAP; reg &= ~MRF24J40_ESLOTG1_CAP;
@ -1042,7 +1042,7 @@ static void mrf24j40_setorder(FAR struct mrf24j40_radio_s *dev, uint8_t bo,
/* If the Sleep Clock Selection, SLPCLKSEL (0x207<7:6), is the internal /* If the Sleep Clock Selection, SLPCLKSEL (0x207<7:6), is the internal
* oscillator (100 kHz), set SLPCLKDIV to a minimum value of 0x01. * oscillator (100 kHz), set SLPCLKDIV to a minimum value of 0x01.
*/ */
mrf24j40_setreg(dev->spi, MRF24J40_SLPCON1, 0x01); mrf24j40_setreg(dev->spi, MRF24J40_SLPCON1, 0x01);
/* Select the source of SLPCLK (internal 100kHz) */ /* Select the source of SLPCLK (internal 100kHz) */
@ -1059,8 +1059,8 @@ static void mrf24j40_setorder(FAR struct mrf24j40_radio_s *dev, uint8_t bo,
/* Calibration is complete when the SLPCALRDY bit (SLPCAL2 0x20B<7>) is /* Calibration is complete when the SLPCALRDY bit (SLPCAL2 0x20B<7>) is
* set to 1. * set to 1.
*/ */
while (!(mrf24j40_getreg(dev->spi, MRF24J40_SLPCAL2) & while (!(mrf24j40_getreg(dev->spi, MRF24J40_SLPCAL2) &
MRF24J40_SLPCAL2_SLPCALRDY)) MRF24J40_SLPCAL2_SLPCALRDY))
{ {
usleep(1); usleep(1);
@ -1073,7 +1073,7 @@ static void mrf24j40_setorder(FAR struct mrf24j40_radio_s *dev, uint8_t bo,
/* Program the Beacon Interval into the Main Counter, MAINCNT (0x229<1:0>, /* Program the Beacon Interval into the Main Counter, MAINCNT (0x229<1:0>,
* 0x228, 0x227, 0x226), and Remain Counter, REMCNT (0x225, 0x224), * 0x228, 0x227, 0x226), and Remain Counter, REMCNT (0x225, 0x224),
* according to BO and SO values. Refer to Section 3.15.1.3 Sleep Mode * according to BO and SO values. Refer to Section 3.15.1.3 Sleep Mode
* Counters * Counters
*/ */
@ -2378,14 +2378,14 @@ static void mrf24j40_irqworker(FAR void *arg)
reg |= MRF24J40_SLPACK_SLPACK; reg |= MRF24J40_SLPACK_SLPACK;
mrf24j40_setreg(dev->spi, MRF24J40_SLPACK, reg); mrf24j40_setreg(dev->spi, MRF24J40_SLPACK, reg);
} }
if ((intstat & MRF24J40_INTSTAT_WAKEIF)) if ((intstat & MRF24J40_INTSTAT_WAKEIF))
{ {
wlinfo("Wake Interrupt\n"); wlinfo("Wake Interrupt\n");
/* This is right before the beacon, we set the bsn here, since the MAC /* This is right before the beacon, we set the bsn here, since the MAC
* uses the SLPIF (end of active portion of superframe). to make any * uses the SLPIF (end of active portion of superframe). to make any
* changes to the beacon. This assumes that any changes to the beacon * changes to the beacon. This assumes that any changes to the beacon
* be in by the time that this interrupt fires. * be in by the time that this interrupt fires.
*/ */
mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++); mrf24j40_setreg(dev->spi, MRF24J40_BEACON_FIFO + 4, dev->bsn++);

View File

@ -288,351 +288,3 @@
#endif /* __DRIVERS_WIRELESS_IEEE802154_MRF24J40_MRF24J40_H */ #endif /* __DRIVERS_WIRELESS_IEEE802154_MRF24J40_MRF24J40_H */

View File

@ -1569,7 +1569,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
* you would have to copy the data over in the case that you actually need * you would have to copy the data over in the case that you actually need
* to notify the next highest layer) * to notify the next highest layer)
*/ */
mac802154_notif_alloc(priv, &notif, false); mac802154_notif_alloc(priv, &notif, false);
beacon = &notif->u.beaconind; beacon = &notif->u.beaconind;
@ -1718,9 +1718,9 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
if (beacon->payloadlength > 0) if (beacon->payloadlength > 0)
{ {
memcpy(beacon->payload, &iob->io_data[iob->io_offset], beacon->payloadlength); memcpy(beacon->payload, &iob->io_data[iob->io_offset], beacon->payloadlength);
} }
/* At this point, we have extracted all relevant info from the incoming frame */ /* At this point, we have extracted all relevant info from the incoming frame */
if (priv->curr_op == MAC802154_OP_SCAN) if (priv->curr_op == MAC802154_OP_SCAN)
@ -1745,7 +1745,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
mac802154_notif_free_locked(priv, notif); mac802154_notif_free_locked(priv, notif);
return; return;
} }
/* TODO: There is supposed to be different logic for the scanning procedure /* TODO: There is supposed to be different logic for the scanning procedure
* based on the macAutoRequest attribute. Currently, we perform scan * based on the macAutoRequest attribute. Currently, we perform scan
* operations as if macAutoRequest is set to TRUE, without actually checking * operations as if macAutoRequest is set to TRUE, without actually checking
@ -1756,7 +1756,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
* via the BEACON.notify primitive, and pass a NULLed out list of pandesc * via the BEACON.notify primitive, and pass a NULLed out list of pandesc
* when SCAN.confirm is sent. * when SCAN.confirm is sent.
*/ */
/* Copy the pan desc to the list of pan desc */ /* Copy the pan desc to the list of pan desc */
memcpy(&priv->pandescs[priv->npandesc], &beacon->pandesc, memcpy(&priv->pandescs[priv->npandesc], &beacon->pandesc,
@ -1793,7 +1793,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
* send a BEACON-NOTFIY.indication in this case, not sure if that * send a BEACON-NOTFIY.indication in this case, not sure if that
* is the right thing to do, can't find anything definitive in standard. * is the right thing to do, can't find anything definitive in standard.
*/ */
if (priv->curr_op == MAC802154_OP_ASSOC && pending_eaddr) if (priv->curr_op == MAC802154_OP_ASSOC && pending_eaddr)
{ {
priv->curr_cmd = IEEE802154_CMD_DATA_REQ; priv->curr_cmd = IEEE802154_CMD_DATA_REQ;
@ -1818,7 +1818,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
* BEACON-NOTIFY.indication primitive if the beacon contains any * BEACON-NOTIFY.indication primitive if the beacon contains any
* payload. * payload.
*/ */
if (beacon->payloadlength > 0) if (beacon->payloadlength > 0)
{ {
/* Unlock the MAC, notify, then lock again */ /* Unlock the MAC, notify, then lock again */
@ -1872,7 +1872,7 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv,
/* If there was a beacon payload, we used the notification, so /* If there was a beacon payload, we used the notification, so
* return here to make sure we don't free the notification. * return here to make sure we don't free the notification.
*/ */
if (beacon->payloadlength > 0) if (beacon->payloadlength > 0)
{ {
return; return;
@ -2112,7 +2112,7 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev)
{ {
eaddr[i] = (CONFIG_IEEE802154_DEFAULT_EADDR >> (8 * i)) & 0xFF; eaddr[i] = (CONFIG_IEEE802154_DEFAULT_EADDR >> (8 * i)) & 0xFF;
} }
mac802154_seteaddr(mac, eaddr); mac802154_seteaddr(mac, eaddr);
return (MACHANDLE)mac; return (MACHANDLE)mac;

View File

@ -246,7 +246,7 @@ int mac802154_req_associate(MACHANDLE mac,
* a beacon frame from the desired coordinator address, we have to just * a beacon frame from the desired coordinator address, we have to just
* send the frame out immediately. * send the frame out immediately.
*/ */
for (i = 0; i < priv->npandesc; i++) for (i = 0; i < priv->npandesc; i++)
{ {
/* Check to make sure the beacon is from the same channel as the request */ /* Check to make sure the beacon is from the same channel as the request */
@ -264,7 +264,7 @@ int mac802154_req_associate(MACHANDLE mac,
/* We have a beacon frame from this coordinator, we can set the /* We have a beacon frame from this coordinator, we can set the
* sfspec and send accordingly. * sfspec and send accordingly.
*/ */
/* Copy in the new superframe spec */ /* Copy in the new superframe spec */
memcpy(&priv->sfspec, &priv->pandescs[i].sfspec, memcpy(&priv->sfspec, &priv->pandescs[i].sfspec,