From 053b6e3d9fe3f7af4fbe138e6096f0120c4b6165 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 3 Jul 2017 10:08:49 -0600 Subject: [PATCH] Fix dangling white space at the end of lines. --- .../wireless/ieee802154/at86rf23x/at86rf23x.c | 156 ++------ .../wireless/ieee802154/mrf24j40/mrf24j40.c | 18 +- .../wireless/ieee802154/mrf24j40/mrf24j40.h | 348 ------------------ wireless/ieee802154/mac802154.c | 18 +- wireless/ieee802154/mac802154_assoc.c | 4 +- 5 files changed, 43 insertions(+), 501 deletions(-) diff --git a/drivers/wireless/ieee802154/at86rf23x/at86rf23x.c b/drivers/wireless/ieee802154/at86rf23x/at86rf23x.c index 1d71f3239c..1fe4250d3a 100644 --- a/drivers/wireless/ieee802154/at86rf23x/at86rf23x.c +++ b/drivers/wireless/ieee802154/at86rf23x/at86rf23x.c @@ -993,226 +993,116 @@ static int at86rf23x_gettxpower(FAR struct ieee802154_radio_s *ieee, /* Right now we only get negative values */ - - - reg = at86rf23x_getreg(dev->spi, RF23X_REG_TXPWR); switch (reg) - { - - case RF23X_TXPWR_POS_4: *txpwr = 0; break; - - - - case RF23X_TXPWR_POS_3_7: - *txpwr = -0; + case RF23X_TXPWR_POS_3_7: + *txpwr =0; break; - - - - case RF23X_TXPWR_POS_3_4: + case RF23X_TXPWR_POS_3_4: *txpwr = 0; - - break; - - case RF23X_TXPWR_POS_3: - *txpwr = - 0; - + *txpwr = 0; break; - - case RF23X_ -TXPWR_POS_2_5: + case RF23X_TXPWR_POS_2_5: *txpwr = 0; - - break; - - case RF23X_TXPWR_POS_2: - + case RF23X_TXPWR_POS_2: *txpwr = 0; - - break; - - case RF23X_TXPWR_POS_1: - *txpwr = 0; break; - - - - case RF23X_TXPWR_0: - *txpwr = -0; + case RF23X_TXPWR_0: + *txpwr =0; break; - - - - case RF23X_TXPWR_NEG_1: + case RF23X_TXPWR_NEG_1: *txpwr = 1000; - break; - - - case RF23X_TXPWR_NE -G_2: + case RF23X_TXPWR_NEG_2: *txpwr = 2000; - - break; - case RF23X_TXPWR_NEG_3: - - -*txpwr = 3000; - + *txpwr = 3000; break; - case RF23X_TXPWR_NEG_4: - - -*txpwr = 4000; - -break; - - + *txpwr = 4000; + break; case RF23X_TXPWR_NEG_6: *txpwr = 6000; - - break; - - case RF23X_TXPWR_NEG_8: *txpwr = 8000; - break; - - - ca -se RF23X_TXPWR_NEG_12: - + case RF23X_TXPWR_NEG_12: *txpwr = 12000; break; - - case RF23X_TXPWR_NEG_17: - - *txpwr = 17 -000; - -break; + *txpwr = 17000; + break; } - - return OK; - } - - -/**** -************************************************************************ - +/**************************************************************************** * Name: at86rf23x_setcca * - * Description: - * Configures if energy detection is used or carrier sense. The base - - * measurement is configured here as well * - - * - - ************************************************************************* -***/ - + ****************************************************************************/ static 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; - - - /* TODO: This doesn't fit the RF233 completely come back to this */ - - if (!cca->use_ed && !cca->use_cs) { - return -EINVAL; - } - - - if (cca->use_cs && cca->csth > 0x0f) { - return -EINVAL; - } - - if (cca->use_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; } diff --git a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.c b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.c index 94b03990e1..5098e96253 100644 --- a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.c +++ b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.c @@ -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 */ mrf24j40_setreg(dev->spi, MRF24J40_FRMOFFSET, 0x15); - + /* 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 * 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; - + case IEEE802154_ATTR_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); - /* 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_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 * oscillator (100 kHz), set SLPCLKDIV to a minimum value of 0x01. */ - + mrf24j40_setreg(dev->spi, MRF24J40_SLPCON1, 0x01); /* 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 * set to ‘1’. */ - - while (!(mrf24j40_getreg(dev->spi, MRF24J40_SLPCAL2) & + + while (!(mrf24j40_getreg(dev->spi, MRF24J40_SLPCAL2) & MRF24J40_SLPCAL2_SLPCALRDY)) { 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>, * 0x228, 0x227, 0x226), and Remain Counter, REMCNT (0x225, 0x224), * 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; mrf24j40_setreg(dev->spi, MRF24J40_SLPACK, reg); } - + if ((intstat & MRF24J40_INTSTAT_WAKEIF)) { wlinfo("Wake Interrupt\n"); /* 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 * 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++); diff --git a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h index 56b5716d1c..c21c2e9f38 100644 --- a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h +++ b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h @@ -288,351 +288,3 @@ #endif /* __DRIVERS_WIRELESS_IEEE802154_MRF24J40_MRF24J40_H */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index ff3ffb65be..09a3ab0274 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -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 * to notify the next highest layer) */ - + mac802154_notif_alloc(priv, ¬if, false); beacon = ¬if->u.beaconind; @@ -1718,9 +1718,9 @@ static void mac802154_rxbeaconframe(FAR struct ieee802154_privmac_s *priv, 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 */ 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); return; } - + /* TODO: There is supposed to be different logic for the scanning procedure * based on the macAutoRequest attribute. Currently, we perform scan * 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 * when SCAN.confirm is sent. */ - + /* Copy the pan desc to the list of pan desc */ 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 * is the right thing to do, can't find anything definitive in standard. */ - + if (priv->curr_op == MAC802154_OP_ASSOC && pending_eaddr) { 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 * payload. */ - + if (beacon->payloadlength > 0) { /* 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 * return here to make sure we don't free the notification. */ - + if (beacon->payloadlength > 0) { return; @@ -2112,7 +2112,7 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev) { eaddr[i] = (CONFIG_IEEE802154_DEFAULT_EADDR >> (8 * i)) & 0xFF; } - + mac802154_seteaddr(mac, eaddr); return (MACHANDLE)mac; diff --git a/wireless/ieee802154/mac802154_assoc.c b/wireless/ieee802154/mac802154_assoc.c index 5d22c1d88d..6f413eafe6 100644 --- a/wireless/ieee802154/mac802154_assoc.c +++ b/wireless/ieee802154/mac802154_assoc.c @@ -246,7 +246,7 @@ int mac802154_req_associate(MACHANDLE mac, * a beacon frame from the desired coordinator address, we have to just * send the frame out immediately. */ - + for (i = 0; i < priv->npandesc; i++) { /* 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 * sfspec and send accordingly. */ - + /* Copy in the new superframe spec */ memcpy(&priv->sfspec, &priv->pandescs[i].sfspec,