summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorKhoronzhuk, Ivan <ivan.khoronzhuk@ti.com>2014-09-05 19:02:48 +0300
committerTom Rini <trini@ti.com>2014-10-23 11:27:04 -0400
commit9ea9021ac466f5ccc8b6238cbce37428bb58f887 (patch)
tree0b024accfec5fab8ba0f9b52151a5095602baf7b /drivers/net
parentef4547176d0fa4d43d060a58c0c902add7fe0aed (diff)
dma: keystone_nav: generalize driver usage
The keystone_nav driver is general driver intended to be used for working with queue manager and pktdma for different IPs like NETCP, AIF, FFTC, etc. So the it's API shouldn't be named like it works only with one of them, it should be general names. The names with prefix like netcp_* rather do for drivers/net/keystone_net.c driver. So it's good to generalize this driver to be used for different IP's and delete confusion with real NETCP driver. The current netcp_* functions of keystone navigator can be used for other settings of pktdma, not only for NETCP. The API of this driver is used by the keystone_net driver to work with NETCP, so net driver also should be corrected. For convenience collect pkdma configurations in drivers/dma/keystone_nav_cfg.c. Acked-by: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/keystone_net.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
index 1cfe6542d8..66532eef20 100644
--- a/drivers/net/keystone_net.c
+++ b/drivers/net/keystone_net.c
@@ -393,7 +393,8 @@ int32_t cpmac_drv_send(u32 *buffer, int num_bytes, int slave_port_num)
if (num_bytes < EMAC_MIN_ETHERNET_PKT_SIZE)
num_bytes = EMAC_MIN_ETHERNET_PKT_SIZE;
- return netcp_send(buffer, num_bytes, (slave_port_num) << 16);
+ return ksnav_send(&netcp_pktdma, buffer,
+ num_bytes, (slave_port_num) << 16);
}
/* Eth device open */
@@ -431,7 +432,7 @@ static int keystone2_eth_open(struct eth_device *dev, bd_t *bis)
printf("ERROR: qm_init()\n");
return -1;
}
- if (netcp_init(&net_rx_buffs)) {
+ if (ksnav_init(&netcp_pktdma, &net_rx_buffs)) {
qm_close();
printf("ERROR: netcp_init()\n");
return -1;
@@ -456,7 +457,7 @@ static int keystone2_eth_open(struct eth_device *dev, bd_t *bis)
link = keystone_get_link_status(dev);
if (link == 0) {
- netcp_close();
+ ksnav_close(&netcp_pktdma);
qm_close();
return -1;
}
@@ -483,7 +484,7 @@ void keystone2_eth_close(struct eth_device *dev)
ethss_stop();
- netcp_close();
+ ksnav_close(&netcp_pktdma);
qm_close();
emac_open = 0;
@@ -530,13 +531,13 @@ static int keystone2_eth_rcv_packet(struct eth_device *dev)
int pkt_size;
u32 *pkt;
- hd = netcp_recv(&pkt, &pkt_size);
+ hd = ksnav_recv(&netcp_pktdma, &pkt, &pkt_size);
if (hd == NULL)
return 0;
NetReceive((uchar *)pkt, pkt_size);
- netcp_release_rxhd(hd);
+ ksnav_release_rxhd(&netcp_pktdma, hd);
return pkt_size;
}