Skip to content

Commit

Permalink
Merge branch 'for-next/net' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
saschahauer committed May 30, 2024
2 parents 6c93fcc + 09b3d16 commit 1b8fa79
Show file tree
Hide file tree
Showing 35 changed files with 122 additions and 193 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ag71xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static void ag71xx_ether_halt(struct eth_device *edev)
}
}

static int ag71xx_ether_rx(struct eth_device *edev)
static void ag71xx_ether_rx(struct eth_device *edev)
{
struct ag71xx *priv = edev->priv;
ag7240_desc_t *f;
Expand Down Expand Up @@ -418,8 +418,6 @@ static int ag71xx_ether_rx(struct eth_device *edev)
ag71xx_wr(priv, AG71XX_REG_RX_DESC, virt_to_phys(f));
ag71xx_wr(priv, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
}

return work_done;
}

static int ag71xx_ether_send(struct eth_device *edev, void *packet, int length)
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ar231x.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static int ar231x_eth_open(struct eth_device *edev)
ar231x_adjust_link, 0, PHY_INTERFACE_MODE_MII);
}

static int ar231x_eth_recv(struct eth_device *edev)
static void ar231x_eth_recv(struct eth_device *edev)
{
struct ar231x_eth_priv *priv = edev->priv;

Expand Down Expand Up @@ -221,7 +221,6 @@ static int ar231x_eth_recv(struct eth_device *edev)
ar231x_flash_rxdsc(rxdsc);
}
priv->kill_rx_ring = 0;
return 0;
}

static int ar231x_eth_send(struct eth_device *edev, void *packet,
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/arc_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static int arc_emac_send(struct eth_device *edev, void *data, int length)
return 0;
}

static int arc_emac_recv(struct eth_device *edev)
static void arc_emac_recv(struct eth_device *edev)
{
struct arc_emac_priv *priv = edev->priv;
unsigned int work_done;
Expand Down Expand Up @@ -307,8 +307,6 @@ static int arc_emac_recv(struct eth_device *edev)

rxbd->info = cpu_to_le32(FOR_EMAC | PKTSIZE);
}

return work_done;
}

static void arc_emac_halt(struct eth_device *edev)
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ static int at91_ether_send(struct eth_device *edev, void *packet, int length)
return 0;
}

static int at91_ether_rx(struct eth_device *edev)
static void at91_ether_rx(struct eth_device *edev)
{
struct ether_device *etdev = to_ether(edev);
int size;
struct rbf_t *rbfp = etdev->rbfp;

if (!(rbfp->addr & RBF_OWNER))
return 0;
return;

size = rbfp->size & RBF_SIZE;

Expand All @@ -230,8 +230,6 @@ static int at91_ether_rx(struct eth_device *edev)

at91_emac_write(AT91_EMAC_RSR,
at91_emac_read(AT91_EMAC_RSR) | AT91_EMAC_RSR_REC);

return size;
}

static void at91_ether_halt (struct eth_device *edev)
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static int bcmgenet_gmac_eth_send(struct eth_device *edev, void *packet, int len
return 0;
}

static int bcmgenet_gmac_eth_recv(struct eth_device *edev)
static void bcmgenet_gmac_eth_recv(struct eth_device *edev)
{
struct bcmgenet_eth_priv *priv = edev->priv;
void *desc_base = priv->mac_reg + GENET_RX_OFF + priv->rx_index * DMA_DESC_SIZE;
Expand All @@ -318,7 +318,7 @@ static int bcmgenet_gmac_eth_recv(struct eth_device *edev)
dma_addr_t addr;

if (prod_index == priv->c_index)
return -EAGAIN;
return;

length = readl(desc_base + DMA_DESC_LENGTH_STATUS);
length = (length >> DMA_BUFLENGTH_SHIFT) & DMA_BUFLENGTH_MASK;
Expand All @@ -343,8 +343,6 @@ static int bcmgenet_gmac_eth_recv(struct eth_device *edev)
/* Forward our descriptor pointer, wrapping around if needed. */
if (++priv->rx_index >= RX_DESCS)
priv->rx_index = 0;

return 0;
}

static void rx_descs_init(struct bcmgenet_eth_priv *priv)
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ static int cpsw_send(struct eth_device *edev, void *packet, int length)
return ret;
}

static int cpsw_recv(struct eth_device *edev)
static void cpsw_recv(struct eth_device *edev)
{
struct cpsw_slave *slave = edev->priv;
struct cpsw_priv *priv = slave->cpsw;
Expand All @@ -1062,8 +1062,6 @@ static int cpsw_recv(struct eth_device *edev)
dma_sync_single_for_device(priv->dev, dma, len, DMA_FROM_DEVICE);
cpdma_submit(priv, &priv->rx_chan, buffer, dma, PKTSIZE, 0);
}

return 0;
}

static void cpsw_slave_init_data(struct cpsw_slave *slave, int slave_num,
Expand Down
19 changes: 9 additions & 10 deletions drivers/net/cs8900.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static int cs8900_send(struct eth_device *dev, void *eth_data,
return 0;
}

static int cs8900_recv(struct eth_device *dev)
static void cs8900_recv(struct eth_device *dev)
{
struct cs8900_priv *priv = (struct cs8900_priv *)dev->priv;
int len = 0;
Expand All @@ -289,21 +289,20 @@ static int cs8900_recv(struct eth_device *dev)
status = cs8900_ior(priv, PP_REG_RXEVENT);
if ((status & RXEVENT_RXOK) == 0) {
/* No packet received. */
return 0;
return;
}

status = readw(priv->regs + CS8900_RTDATA0);
len = readw(priv->regs + CS8900_RTDATA0);

for (addr = (u16 *)priv->rx_buf, i = len >> 1; i > 0; i--) {
*addr++ = readw(priv->regs + CS8900_RTDATA0);
if (len <= PKTSIZE) {
for (addr = (u16 *)priv->rx_buf, i = (len + 1) >> 1; i > 0; i--)
*addr++ = readw(priv->regs + CS8900_RTDATA0);
net_receive(dev, priv->rx_buf, len);
} else {
for (addr = (u16 *)priv->rx_buf, i = (len + 1) >> 1; i > 0; i--)
(void)readw(priv->regs + CS8900_RTDATA0);
}
if (len & 1) {
*addr++ = readw(priv->regs + CS8900_RTDATA0);
}
net_receive(dev, priv->rx_buf, len);

return len;
}

static void cs8900_halt(struct eth_device *dev)
Expand Down
11 changes: 3 additions & 8 deletions drivers/net/davinci_emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,21 +457,19 @@ static int davinci_emac_send(struct eth_device *edev, void *packet, int length)
/*
* This function handles receipt of a packet from the network
*/
static int davinci_emac_recv(struct eth_device *edev)
static void davinci_emac_recv(struct eth_device *edev)
{
struct davinci_emac_priv *priv = edev->priv;
void __iomem *rx_curr_desc, *curr_desc, *tail_desc;
unsigned char *pkt;
int status, len, ret = -1;
int status, len;

dev_dbg(priv->dev, "+ emac_recv\n");

rx_curr_desc = priv->emac_rx_active_head;
status = readl(rx_curr_desc + EMAC_DESC_PKT_FLAG_LEN);
if (status & EMAC_CPPI_OWNERSHIP_BIT) {
ret = 0;
if (status & EMAC_CPPI_OWNERSHIP_BIT)
goto out;
}

if (status & EMAC_CPPI_RX_ERROR_FRAME) {
/* Error in packet - discard it and requeue desc */
Expand All @@ -483,7 +481,6 @@ static int davinci_emac_recv(struct eth_device *edev)
dma_sync_single_for_cpu(priv->dev, (unsigned long)pkt, len, DMA_FROM_DEVICE);
net_receive(edev, pkt, len);
dma_sync_single_for_device(priv->dev, (unsigned long)pkt, len, DMA_FROM_DEVICE);
ret = len;
}

/* Ack received packet descriptor */
Expand Down Expand Up @@ -529,8 +526,6 @@ static int davinci_emac_recv(struct eth_device *edev)

out:
dev_dbg(priv->dev, "- emac_recv\n");

return ret;
}

static int davinci_emac_probe(struct device *dev)
Expand Down
9 changes: 2 additions & 7 deletions drivers/net/designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,18 @@ static int dwc_ether_send(struct eth_device *dev, void *packet, int length)
return 0;
}

static int dwc_ether_rx(struct eth_device *dev)
static void dwc_ether_rx(struct eth_device *dev)
{
struct dw_eth_dev *priv = dev->priv;
u32 desc_num = priv->rx_currdescnum;
struct dmamacdescr *desc_p = &priv->rx_mac_descrtable_cpu[desc_num];

u32 status = desc_p->txrx_status;
int length = 0;
int ret = 0;

/* Check if the owner is the CPU */
if (status & DESC_RXSTS_OWNBYDMA)
return 0;
return;

if ((status & (DESC_RXSTS_ERROR | DESC_RXSTS_DAFILTERFAIL |
DESC_RXSTS_SAFILTERFAIL)) ||
Expand All @@ -353,7 +352,6 @@ static int dwc_ether_rx(struct eth_device *dev)
DESC_RXSTS_RXWATCHDOG |
DESC_RXSTS_RXMIIERROR |
DESC_RXSTS_RXCRC));
ret = -EIO;
} else {
length = (status & DESC_RXSTS_FRMLENMSK) >>
DESC_RXSTS_FRMLENSHFT;
Expand All @@ -363,7 +361,6 @@ static int dwc_ether_rx(struct eth_device *dev)
net_receive(dev, dmamac_addr(desc_p), length);
dma_sync_single_for_device(dev->parent, desc_p->dmamac_addr,
length, DMA_FROM_DEVICE);
ret = length;
}

/*
Expand All @@ -377,8 +374,6 @@ static int dwc_ether_rx(struct eth_device *dev)
desc_num = 0;

priv->rx_currdescnum = desc_num;

return ret;
}

static void dwc_ether_halt (struct eth_device *dev)
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/designware_eqos.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ static int eqos_send(struct eth_device *edev, void *packet, int length)
return ret;
}

static int eqos_recv(struct eth_device *edev)
static void eqos_recv(struct eth_device *edev)
{
struct eqos *eqos = edev->priv;
struct eqos_desc *rx_wbf_desc, *rx_rf_desc;
Expand All @@ -763,7 +763,7 @@ static int eqos_recv(struct eth_device *edev)
/* Write-Back Format RX descriptor */
rx_wbf_desc = &eqos->rx_descs[eqos->rx_currdescnum];
if (readl(&rx_wbf_desc->des3) & EQOS_DESC3_OWN)
return 0;
return;

dma = eqos->dma_rx_buf[eqos->rx_currdescnum];
frame = phys_to_virt(dma);
Expand Down Expand Up @@ -792,8 +792,6 @@ static int eqos_recv(struct eth_device *edev)

eqos->rx_currdescnum++;
eqos->rx_currdescnum %= EQOS_DESCRIPTORS_RX;

return 0;
}

static int eqos_init_resources(struct eqos *eqos)
Expand Down
12 changes: 5 additions & 7 deletions drivers/net/dm9k.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,20 +597,20 @@ static int dm9k_validate_entry(struct dm9k *priv)
return 1; /* entry is valid */
}

static int dm9k_eth_rx(struct eth_device *edev)
static void dm9k_eth_rx(struct eth_device *edev)
{
struct dm9k *priv = (struct dm9k *)edev->priv;
struct device *dev = edev->parent;
unsigned rx_stat = 0, rx_len = 0;
bool p_valid;

if (dm9k_check_for_rx_packet(priv) == 0)
return 0; /* no data present */
return; /* no data present */

do {
if (!dm9k_validate_entry(priv)) {
dm9k_iow(priv, DM9K_ISR, ISR_PR); /* clear PR status latched in bit 0 */
return 0;
return;
}

/* assume this packet is valid */
Expand Down Expand Up @@ -649,22 +649,20 @@ static int dm9k_eth_rx(struct eth_device *edev)
dm9k_dump(priv->buswidth, priv->iodata, rx_len);
dm9k_reset(priv);
dm9k_enable(priv);
return 0;
return;
}

if (p_valid == true) {
dev_dbg(dev, "Receiving packet\n");
dm9k_rd(priv->buswidth, priv->iodata, priv->pckt, rx_len);
dev_dbg(dev, "passing %u bytes packet to upper layer\n", rx_len);
net_receive(edev, priv->pckt, rx_len);
return 0;
return;
} else {
dev_dbg(dev, "Discarding packet\n");
dm9k_dump(priv->buswidth, priv->iodata, rx_len); /* discard packet */
}
} while (1);

return 0;
}


Expand Down
6 changes: 2 additions & 4 deletions drivers/net/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,17 @@ static int dsa_port_send(struct eth_device *edev, void *packet, int length)
return eth_send_raw(ds->edev_master, tx_buf, full_length);
}

static int dsa_port_recv(struct eth_device *edev)
static void dsa_port_recv(struct eth_device *edev)
{
struct dsa_port *dp = edev->priv;
int length;

if (!dp->rx_buf_length)
return 0;
return;

net_receive(edev, dp->rx_buf, dp->rx_buf_length);
length = dp->rx_buf_length;
dp->rx_buf_length = 0;

return length;
}

static int dsa_ether_set_ethaddr(struct eth_device *edev,
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/e1000/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ static void e1000_configure_rx(struct e1000_hw *hw)
e1000_fill_rx(hw);
}

static int e1000_poll(struct eth_device *edev)
static void e1000_poll(struct eth_device *edev)
{
struct e1000_hw *hw = edev->priv;
struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_last];
Expand All @@ -3446,10 +3446,7 @@ static int e1000_poll(struct eth_device *edev)
dma_sync_single_for_device(hw->dev, hw->packet_dma, len,
DMA_FROM_DEVICE);
e1000_fill_rx(hw);
return 1;
}

return 0;
}

static int e1000_transmit(struct eth_device *edev, void *txpacket, int length)
Expand Down
8 changes: 3 additions & 5 deletions drivers/net/efi-snp.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,22 @@ static int efi_snp_eth_send(struct eth_device *edev, void *packet, int length)
return -ETIMEDOUT;
}

static int efi_snp_eth_rx(struct eth_device *edev)
static void efi_snp_eth_rx(struct eth_device *edev)
{
struct efi_snp_priv *priv = to_priv(edev);
long bufsize = PKTSIZE;
efi_status_t efiret;

efiret = priv->snp->receive(priv->snp, NULL, &bufsize, priv->rx_buf, NULL, NULL, NULL);
if (efiret == EFI_NOT_READY)
return 0;
return;

if (EFI_ERROR(efiret)) {
dev_err(priv->dev, "failed to receive: %s\n", efi_strerror(efiret));
return -efi_errno(efiret);
return;
}

net_receive(edev, priv->rx_buf, bufsize);

return 0;
}

static efi_guid_t snp_guid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
Expand Down
Loading

0 comments on commit 1b8fa79

Please sign in to comment.