net: ip: Fix compiling with 15.4

Kconfig allows selecting NETWORKING_WITH_15_4_TI_CC2520 even if the
current board doesn't support it, and also selects it by default. This
breaks building the 15.4 sample with qemu_x86. Add a config option for
having CC2520 support and enable the choise only if it is available.

In addition, remove unused function from iee802154 code, as it now
fails the tests.

Jira: ZEP-697

Change-Id: Ib082f82acdd0f86d3306bbd3bb827f61b0fd0be1
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This commit is contained in:
Jaakko Hannikainen 2016-08-22 09:49:57 +03:00 committed by Anas Nashif
parent 09cf85a94b
commit db493450ac
5 changed files with 11 additions and 50 deletions

View file

@ -2,3 +2,4 @@
config BOARD_QUARK_SE_DEVBOARD
bool "Quark SE Development Board"
depends on SOC_QUARK_SE
select NETWORKING_HAVE_TI_CC2520

View file

@ -36,6 +36,9 @@
menu "IEEE 802.15.4 Options"
depends on NETWORKING_WITH_15_4
config NETWORKING_HAVE_TI_CC2520
bool
if NETWORKING_WITH_15_4_TI_CC2520
config SYS_LOG_TI_CC2520_LEVEL

View file

@ -769,56 +769,6 @@ static int cc2520_set_ieee_addr(struct device *dev, const uint8_t *ieee_addr)
return 0;
}
static int cc2520_set_txpower(struct device *dev, short dbm)
{
struct cc2520_context *cc2520 = dev->driver_data;
uint8_t pwr;
SYS_LOG_DBG("%s: %d\n", dbm);
/* See chapter 19 part 8 */
switch (dbm) {
case 5:
pwr = 0xF7;
break;
case 3:
pwr = 0xF2;
break;
case 2:
pwr = 0xAB;
break;
case 1:
pwr = 0x13;
break;
case 0:
pwr = 0x32;
break;
case -2:
pwr = 0x81;
break;
case -4:
pwr = 0x88;
break;
case -7:
pwr = 0x2C;
break;
case -18:
pwr = 0x03;
break;
default:
goto error;
}
if (!write_reg_txpower(&cc2520->spi, pwr)) {
goto error;
}
return 0;
error:
SYS_LOG_ERR("%s: FAILED\n");
return -EIO;
}
static int cc2520_tx(struct device *dev, struct net_buf *buf)
{
struct cc2520_context *cc2520 = dev->driver_data;

View file

@ -411,12 +411,15 @@ default n
help
The 802.15.4 layer can either support loopback within
or loopback with uart but not both at the same time.
if NETWORKING_HAVE_TI_CC2520
config NETWORKING_WITH_15_4_TI_CC2520
bool
prompt "TI CC2520"
select TEST_RANDOM_GENERATOR
help
Enable Texas Instruments CC2520 802.15.4 radio driver.
endif
config NETWORKING_WITH_15_4_LOOPBACK
bool

View file

@ -0,0 +1,4 @@
[test]
tags = net
platform_exclude = arduino_101_sss quark_se_sss_devboard
build_only = true