Commit 8c5f9a8c authored by David S. Miller's avatar David S. Miller

Merge branch 'ieee802154-for-davem-2017-11-09' of...

Merge branch 'ieee802154-for-davem-2017-11-09' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next

Stefan Schmidt says:

====================
pull-request: net-next: ieee802154 2017-11-09

A small update on ieee802154 patches for net-next. Nothing dramatic, but simply
housekeeping this time around.
A fix for the correct mask to be applied in the mrf24j40 driver by Gustavo A. R. Silva
Removal of a non existing email user for the ca8210 driver by Harry Morris
A bunch of checkpatch cleanups across the subsystem from myself
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3ec26c79 7558bd50
......@@ -3084,7 +3084,6 @@ F: arch/c6x/
CA8210 IEEE-802.15.4 RADIO DRIVER
M: Harry Morris <h.morris@cascoda.com>
M: linuxdev@cascoda.com
L: linux-wpan@vger.kernel.org
W: https://github.com/Cascoda/ca8210-linux.git
S: Maintained
......
......@@ -311,8 +311,8 @@ static int adf7242_status(struct adf7242_local *lp, u8 *stat)
return status;
}
static int adf7242_wait_status(struct adf7242_local *lp, unsigned status,
unsigned mask, int line)
static int adf7242_wait_status(struct adf7242_local *lp, unsigned int status,
unsigned int mask, int line)
{
int cnt = 0, ret = 0;
u8 stat;
......@@ -477,7 +477,7 @@ static int adf7242_write_reg(struct adf7242_local *lp, u16 addr, u8 data)
return status;
}
static int adf7242_cmd(struct adf7242_local *lp, unsigned cmd)
static int adf7242_cmd(struct adf7242_local *lp, unsigned int cmd)
{
int status;
......@@ -920,7 +920,7 @@ static void adf7242_debug(u8 irq1)
static irqreturn_t adf7242_isr(int irq, void *data)
{
struct adf7242_local *lp = data;
unsigned xmit;
unsigned int xmit;
u8 irq1;
adf7242_wait_status(lp, RC_STATUS_PHY_RDY, RC_STATUS_MASK, __LINE__);
......
......@@ -61,7 +61,7 @@ struct atusb {
struct usb_ctrlrequest tx_dr;
struct urb *tx_urb;
struct sk_buff *tx_skb;
uint8_t tx_ack_seq; /* current TX ACK sequence number */
u8 tx_ack_seq; /* current TX ACK sequence number */
/* Firmware variable */
unsigned char fw_ver_maj; /* Firmware major version number */
......@@ -99,44 +99,43 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
if (ret < 0) {
atusb->err = ret;
dev_err(&usb_dev->dev,
"atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
request, value, index, ret);
"%s: req 0x%02x val 0x%x idx 0x%x, error %d\n",
__func__, request, value, index, ret);
}
return ret;
}
static int atusb_command(struct atusb *atusb, uint8_t cmd, uint8_t arg)
static int atusb_command(struct atusb *atusb, u8 cmd, u8 arg)
{
struct usb_device *usb_dev = atusb->usb_dev;
dev_dbg(&usb_dev->dev, "atusb_command: cmd = 0x%x\n", cmd);
dev_dbg(&usb_dev->dev, "%s: cmd = 0x%x\n", __func__, cmd);
return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
cmd, ATUSB_REQ_TO_DEV, arg, 0, NULL, 0, 1000);
}
static int atusb_write_reg(struct atusb *atusb, uint8_t reg, uint8_t value)
static int atusb_write_reg(struct atusb *atusb, u8 reg, u8 value)
{
struct usb_device *usb_dev = atusb->usb_dev;
dev_dbg(&usb_dev->dev, "atusb_write_reg: 0x%02x <- 0x%02x\n",
reg, value);
dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
ATUSB_REG_WRITE, ATUSB_REQ_TO_DEV,
value, reg, NULL, 0, 1000);
}
static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
static int atusb_read_reg(struct atusb *atusb, u8 reg)
{
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
uint8_t *buffer;
uint8_t value;
u8 *buffer;
u8 value;
buffer = kmalloc(1, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
dev_dbg(&usb_dev->dev, "%s: reg = 0x%x\n", __func__, reg);
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
0, reg, buffer, 1, 1000);
......@@ -151,15 +150,14 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
}
}
static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
uint8_t shift, uint8_t value)
static int atusb_write_subreg(struct atusb *atusb, u8 reg, u8 mask,
u8 shift, u8 value)
{
struct usb_device *usb_dev = atusb->usb_dev;
uint8_t orig, tmp;
u8 orig, tmp;
int ret = 0;
dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
reg, value);
dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
orig = atusb_read_reg(atusb, reg);
......@@ -261,12 +259,12 @@ static void atusb_work_urbs(struct work_struct *work)
/* ----- Asynchronous USB -------------------------------------------------- */
static void atusb_tx_done(struct atusb *atusb, uint8_t seq)
static void atusb_tx_done(struct atusb *atusb, u8 seq)
{
struct usb_device *usb_dev = atusb->usb_dev;
uint8_t expect = atusb->tx_ack_seq;
u8 expect = atusb->tx_ack_seq;
dev_dbg(&usb_dev->dev, "atusb_tx_done (0x%02x/0x%02x)\n", seq, expect);
dev_dbg(&usb_dev->dev, "%s (0x%02x/0x%02x)\n", __func__, seq, expect);
if (seq == expect) {
/* TODO check for ifs handling in firmware */
ieee802154_xmit_complete(atusb->hw, atusb->tx_skb, false);
......@@ -287,7 +285,7 @@ static void atusb_in_good(struct urb *urb)
struct usb_device *usb_dev = urb->dev;
struct sk_buff *skb = urb->context;
struct atusb *atusb = SKB_ATUSB(skb);
uint8_t len, lqi;
u8 len, lqi;
if (!urb->actual_length) {
dev_dbg(&usb_dev->dev, "atusb_in: zero-sized URB ?\n");
......@@ -326,7 +324,7 @@ static void atusb_in(struct urb *urb)
struct sk_buff *skb = urb->context;
struct atusb *atusb = SKB_ATUSB(skb);
dev_dbg(&usb_dev->dev, "atusb_in: status %d len %d\n",
dev_dbg(&usb_dev->dev, "%s: status %d len %d\n", __func__,
urb->status, urb->actual_length);
if (urb->status) {
if (urb->status == -ENOENT) { /* being killed */
......@@ -334,7 +332,7 @@ static void atusb_in(struct urb *urb)
urb->context = NULL;
return;
}
dev_dbg(&usb_dev->dev, "atusb_in: URB error %d\n", urb->status);
dev_dbg(&usb_dev->dev, "%s: URB error %d\n", __func__, urb->status);
} else {
atusb_in_good(urb);
}
......@@ -388,7 +386,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
dev_dbg(&usb_dev->dev, "atusb_xmit (%d)\n", skb->len);
dev_dbg(&usb_dev->dev, "%s (%d)\n", __func__, skb->len);
atusb->tx_skb = skb;
atusb->tx_ack_seq++;
atusb->tx_dr.wIndex = cpu_to_le16(atusb->tx_ack_seq);
......@@ -399,13 +397,13 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
(unsigned char *)&atusb->tx_dr, skb->data,
skb->len, atusb_xmit_complete, NULL);
ret = usb_submit_urb(atusb->tx_urb, GFP_ATOMIC);
dev_dbg(&usb_dev->dev, "atusb_xmit done (%d)\n", ret);
dev_dbg(&usb_dev->dev, "%s done (%d)\n", __func__, ret);
return ret;
}
static int atusb_ed(struct ieee802154_hw *hw, u8 *level)
{
BUG_ON(!level);
WARN_ON(!level);
*level = 0xbe;
return 0;
}
......@@ -420,7 +418,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
dev_vdbg(dev, "atusb_set_hw_addr_filt called for saddr\n");
dev_vdbg(dev, "%s called for saddr\n", __func__);
atusb_write_reg(atusb, RG_SHORT_ADDR_0, addr);
atusb_write_reg(atusb, RG_SHORT_ADDR_1, addr >> 8);
}
......@@ -428,7 +426,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
u16 pan = le16_to_cpu(filt->pan_id);
dev_vdbg(dev, "atusb_set_hw_addr_filt called for pan id\n");
dev_vdbg(dev, "%s called for pan id\n", __func__);
atusb_write_reg(atusb, RG_PAN_ID_0, pan);
atusb_write_reg(atusb, RG_PAN_ID_1, pan >> 8);
}
......@@ -437,14 +435,13 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
u8 i, addr[IEEE802154_EXTENDED_ADDR_LEN];
memcpy(addr, &filt->ieee_addr, IEEE802154_EXTENDED_ADDR_LEN);
dev_vdbg(dev, "atusb_set_hw_addr_filt called for IEEE addr\n");
dev_vdbg(dev, "%s called for IEEE addr\n", __func__);
for (i = 0; i < 8; i++)
atusb_write_reg(atusb, RG_IEEE_ADDR_0 + i, addr[i]);
}
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
dev_vdbg(dev,
"atusb_set_hw_addr_filt called for panc change\n");
dev_vdbg(dev, "%s called for panc change\n", __func__);
if (filt->pan_coord)
atusb_write_subreg(atusb, SR_AACK_I_AM_COORD, 1);
else
......@@ -460,7 +457,7 @@ static int atusb_start(struct ieee802154_hw *hw)
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
dev_dbg(&usb_dev->dev, "atusb_start\n");
dev_dbg(&usb_dev->dev, "%s\n", __func__);
schedule_delayed_work(&atusb->work, 0);
atusb_command(atusb, ATUSB_RX_MODE, 1);
ret = atusb_get_and_clear_error(atusb);
......@@ -474,7 +471,7 @@ static void atusb_stop(struct ieee802154_hw *hw)
struct atusb *atusb = hw->priv;
struct usb_device *usb_dev = atusb->usb_dev;
dev_dbg(&usb_dev->dev, "atusb_stop\n");
dev_dbg(&usb_dev->dev, "%s\n", __func__);
usb_kill_anchored_urbs(&atusb->idle_urbs);
atusb_command(atusb, ATUSB_RX_MODE, 0);
atusb_get_and_clear_error(atusb);
......@@ -842,7 +839,8 @@ static int atusb_get_and_show_revision(struct atusb *atusb)
dev_info(&usb_dev->dev,
"Firmware: major: %u, minor: %u, hardware type: %s (%d)\n",
atusb->fw_ver_maj, atusb->fw_ver_min, hw_name, atusb->fw_hw_type);
atusb->fw_ver_maj, atusb->fw_ver_min, hw_name,
atusb->fw_hw_type);
}
if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 2) {
dev_info(&usb_dev->dev,
......@@ -880,7 +878,7 @@ static int atusb_get_and_show_build(struct atusb *atusb)
static int atusb_get_and_conf_chip(struct atusb *atusb)
{
struct usb_device *usb_dev = atusb->usb_dev;
uint8_t man_id_0, man_id_1, part_num, version_num;
u8 man_id_0, man_id_1, part_num, version_num;
const char *chip;
struct ieee802154_hw *hw = atusb->hw;
......@@ -977,7 +975,8 @@ static int atusb_set_extended_addr(struct atusb *atusb)
int ret;
/* Firmware versions before 0.3 do not support the EUI64_READ command.
* Just use a random address and be done */
* Just use a random address and be done.
*/
if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 3) {
ieee802154_random_extended_addr(&atusb->hw->phy->perm_extended_addr);
return 0;
......@@ -1129,7 +1128,7 @@ static void atusb_disconnect(struct usb_interface *interface)
{
struct atusb *atusb = usb_get_intfdata(interface);
dev_dbg(&atusb->usb_dev->dev, "atusb_disconnect\n");
dev_dbg(&atusb->usb_dev->dev, "%s\n", __func__);
atusb->shutdown = 1;
cancel_delayed_work_sync(&atusb->work);
......@@ -1146,7 +1145,7 @@ static void atusb_disconnect(struct usb_interface *interface)
usb_set_intfdata(interface, NULL);
usb_put_dev(atusb->usb_dev);
pr_debug("atusb_disconnect done\n");
pr_debug("%s done\n", __func__);
}
/* The devices we work with */
......
......@@ -924,7 +924,7 @@ static int ca8210_spi_transfer(
priv = spi_get_drvdata(spi);
reinit_completion(&priv->spi_transfer_complete);
dev_dbg(&spi->dev, "ca8210_spi_transfer called\n");
dev_dbg(&spi->dev, "%s called\n", __func__);
cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
if (!cas_ctl)
......@@ -1303,7 +1303,7 @@ static u8 tdme_checkpibattribute(
break;
/* MAC */
case MAC_BATT_LIFE_EXT_PERIODS:
if ((value < 6) || (value > 41))
if (value < 6 || value > 41)
status = MAC_INVALID_PARAMETER;
break;
case MAC_BEACON_PAYLOAD:
......@@ -1319,7 +1319,7 @@ static u8 tdme_checkpibattribute(
status = MAC_INVALID_PARAMETER;
break;
case MAC_MAX_BE:
if ((value < 3) || (value > 8))
if (value < 3 || value > 8)
status = MAC_INVALID_PARAMETER;
break;
case MAC_MAX_CSMA_BACKOFFS:
......@@ -1335,7 +1335,7 @@ static u8 tdme_checkpibattribute(
status = MAC_INVALID_PARAMETER;
break;
case MAC_RESPONSE_WAIT_TIME:
if ((value < 2) || (value > 64))
if (value < 2 || value > 64)
status = MAC_INVALID_PARAMETER;
break;
case MAC_SUPERFRAME_ORDER:
......@@ -1511,7 +1511,7 @@ static u8 mcps_data_request(
psec = (struct secspec *)(command.pdata.data_req.msdu + msdu_length);
command.length = sizeof(struct mcps_data_request_pset) -
MAX_DATA_SIZE + msdu_length;
if (!security || (security->security_level == 0)) {
if (!security || security->security_level == 0) {
psec->security_level = 0;
command.length += 1;
} else {
......@@ -1561,7 +1561,7 @@ static u8 mlme_reset_request_sync(
status = response.pdata.status;
/* reset COORD Bit for Channel Filtering as Coordinator */
if (CA8210_MAC_WORKAROUNDS && set_default_pib && (!status)) {
if (CA8210_MAC_WORKAROUNDS && set_default_pib && !status) {
status = tdme_setsfr_request_sync(
0,
CA8210_SFR_MACCON,
......@@ -1898,7 +1898,7 @@ static int ca8210_net_rx(struct ieee802154_hw *hw, u8 *command, size_t len)
unsigned long flags;
u8 status;
dev_dbg(&priv->spi->dev, "ca8210_net_rx(), CmdID = %d\n", command[0]);
dev_dbg(&priv->spi->dev, "%s: CmdID = %d\n", __func__, command[0]);
if (command[0] == SPI_MCPS_DATA_INDICATION) {
/* Received data */
......@@ -1948,7 +1948,7 @@ static int ca8210_skb_tx(
struct secspec secspec;
unsigned int mac_len;
dev_dbg(&priv->spi->dev, "ca8210_skb_tx() called\n");
dev_dbg(&priv->spi->dev, "%s called\n", __func__);
/* Get addressing info from skb - ieee802154 layer creates a full
* packet
......@@ -2051,7 +2051,7 @@ static int ca8210_xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb)
struct ca8210_priv *priv = hw->priv;
int status;
dev_dbg(&priv->spi->dev, "calling ca8210_xmit_async()\n");
dev_dbg(&priv->spi->dev, "calling %s\n", __func__);
priv->tx_skb = skb;
priv->async_tx_pending = true;
......@@ -2369,7 +2369,7 @@ static int ca8210_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
MAC_PROMISCUOUS_MODE,
0,
1,
(const void*)&on,
(const void *)&on,
priv->spi
);
if (status) {
......
......@@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
}
spin_lock_irqsave(&priv->lock, flags);
BUG_ON(priv->is_tx);
WARN_ON(priv->is_tx);
priv->is_tx = 1;
spin_unlock_irqrestore(&priv->lock, flags);
......@@ -643,12 +643,12 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
dev_dbg(&priv->spi->dev, "trying to set channel\n");
BUG_ON(page != 0);
BUG_ON(channel < CC2520_MINCHANNEL);
BUG_ON(channel > CC2520_MAXCHANNEL);
WARN_ON(page != 0);
WARN_ON(channel < CC2520_MINCHANNEL);
WARN_ON(channel > CC2520_MAXCHANNEL);
ret = cc2520_write_register(priv, CC2520_FREQCTRL,
11 + 5*(channel - 11));
11 + 5 * (channel - 11));
return ret;
}
......@@ -663,15 +663,14 @@ cc2520_filter(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
u16 panid = le16_to_cpu(filt->pan_id);
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for pan id\n");
dev_vdbg(&priv->spi->dev, "%s called for pan id\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_PANID,
sizeof(panid), (u8 *)&panid);
}
if (changed & IEEE802154_AFILT_IEEEADDR_CHANGED) {
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for IEEE addr\n");
"%s called for IEEE addr\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_IEEEADDR,
sizeof(filt->ieee_addr),
(u8 *)&filt->ieee_addr);
......@@ -680,8 +679,7 @@ cc2520_filter(struct ieee802154_hw *hw,
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for saddr\n");
dev_vdbg(&priv->spi->dev, "%s called for saddr\n", __func__);
ret = cc2520_write_ram(priv, CC2520RAM_SHORTADDR,
sizeof(addr), (u8 *)&addr);
}
......@@ -690,7 +688,7 @@ cc2520_filter(struct ieee802154_hw *hw,
u8 frmfilt0;
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for panc change\n");
"%s called for panc change\n", __func__);
cc2520_read_register(priv, CC2520_FRMFILT0, &frmfilt0);
......@@ -929,6 +927,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
if (!np) {
struct cc2520_platform_data *spi_pdata = spi->dev.platform_data;
if (!spi_pdata)
return -ENOENT;
*pdata = *spi_pdata;
......
......@@ -635,7 +635,7 @@ static void mrf24j40_stop(struct ieee802154_hw *hw)
/* Set TXNIE and RXIE. Disable Interrupts */
regmap_update_bits(devrec->regmap_short, REG_INTCON,
BIT_TXNIE | BIT_TXNIE, BIT_TXNIE | BIT_TXNIE);
BIT_TXNIE | BIT_RXIE, BIT_TXNIE | BIT_RXIE);
}
static int mrf24j40_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment