|
@@ -186,21 +186,6 @@ void __iomem *vnic_dev_get_res(struct vnic_dev *vdev, enum vnic_res_type type,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-dma_addr_t vnic_dev_get_res_bus_addr(struct vnic_dev *vdev,
|
|
|
- enum vnic_res_type type, unsigned int index)
|
|
|
-{
|
|
|
- switch (type) {
|
|
|
- case RES_TYPE_WQ:
|
|
|
- case RES_TYPE_RQ:
|
|
|
- case RES_TYPE_CQ:
|
|
|
- case RES_TYPE_INTR_CTRL:
|
|
|
- return vdev->res[type].bus_addr +
|
|
|
- index * VNIC_RES_STRIDE;
|
|
|
- default:
|
|
|
- return vdev->res[type].bus_addr;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
unsigned int vnic_dev_desc_ring_size(struct vnic_dev_ring *ring,
|
|
|
unsigned int desc_count, unsigned int desc_size)
|
|
|
{
|
|
@@ -384,18 +369,6 @@ static int vnic_dev_cmd_no_proxy(struct vnic_dev *vdev,
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-void vnic_dev_cmd_proxy_by_bdf_start(struct vnic_dev *vdev, u16 bdf)
|
|
|
-{
|
|
|
- vdev->proxy = PROXY_BY_BDF;
|
|
|
- vdev->proxy_index = bdf;
|
|
|
-}
|
|
|
-
|
|
|
-void vnic_dev_cmd_proxy_end(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- vdev->proxy = PROXY_NONE;
|
|
|
- vdev->proxy_index = 0;
|
|
|
-}
|
|
|
-
|
|
|
int vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
|
|
|
u64 *a0, u64 *a1, int wait)
|
|
|
{
|
|
@@ -488,13 +461,6 @@ int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size,
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-int vnic_dev_stats_clear(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- u64 a0 = 0, a1 = 0;
|
|
|
- int wait = 1000;
|
|
|
- return vnic_dev_cmd(vdev, CMD_STATS_CLEAR, &a0, &a1, wait);
|
|
|
-}
|
|
|
-
|
|
|
int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats)
|
|
|
{
|
|
|
u64 a0, a1;
|
|
@@ -528,19 +494,6 @@ int vnic_dev_enable(struct vnic_dev *vdev)
|
|
|
return vnic_dev_cmd(vdev, CMD_ENABLE, &a0, &a1, wait);
|
|
|
}
|
|
|
|
|
|
-int vnic_dev_enable_wait(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- u64 a0 = 0, a1 = 0;
|
|
|
- int wait = 1000;
|
|
|
- int err;
|
|
|
-
|
|
|
- err = vnic_dev_cmd(vdev, CMD_ENABLE_WAIT, &a0, &a1, wait);
|
|
|
- if (err == ERR_ECMDUNKNOWN)
|
|
|
- return vnic_dev_cmd(vdev, CMD_ENABLE, &a0, &a1, wait);
|
|
|
-
|
|
|
- return err;
|
|
|
-}
|
|
|
-
|
|
|
int vnic_dev_disable(struct vnic_dev *vdev)
|
|
|
{
|
|
|
u64 a0 = 0, a1 = 0;
|
|
@@ -680,26 +633,6 @@ int vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-int vnic_dev_packet_filter_all(struct vnic_dev *vdev, int directed,
|
|
|
- int multicast, int broadcast, int promisc, int allmulti)
|
|
|
-{
|
|
|
- u64 a0, a1 = 0;
|
|
|
- int wait = 1000;
|
|
|
- int err;
|
|
|
-
|
|
|
- a0 = (directed ? CMD_PFILTER_DIRECTED : 0) |
|
|
|
- (multicast ? CMD_PFILTER_MULTICAST : 0) |
|
|
|
- (broadcast ? CMD_PFILTER_BROADCAST : 0) |
|
|
|
- (promisc ? CMD_PFILTER_PROMISCUOUS : 0) |
|
|
|
- (allmulti ? CMD_PFILTER_ALL_MULTICAST : 0);
|
|
|
-
|
|
|
- err = vnic_dev_cmd(vdev, CMD_PACKET_FILTER_ALL, &a0, &a1, wait);
|
|
|
- if (err)
|
|
|
- pr_err("Can't set packet filter\n");
|
|
|
-
|
|
|
- return err;
|
|
|
-}
|
|
|
-
|
|
|
int vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
|
|
|
{
|
|
|
u64 a0 = 0, a1 = 0;
|
|
@@ -748,19 +681,6 @@ int vnic_dev_set_ig_vlan_rewrite_mode(struct vnic_dev *vdev,
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr)
|
|
|
-{
|
|
|
- u64 a0 = intr, a1 = 0;
|
|
|
- int wait = 1000;
|
|
|
- int err;
|
|
|
-
|
|
|
- err = vnic_dev_cmd(vdev, CMD_IAR, &a0, &a1, wait);
|
|
|
- if (err)
|
|
|
- pr_err("Failed to raise INTR[%d], err %d\n", intr, err);
|
|
|
-
|
|
|
- return err;
|
|
|
-}
|
|
|
-
|
|
|
int vnic_dev_notify_setcmd(struct vnic_dev *vdev,
|
|
|
void *notify_addr, dma_addr_t notify_pa, u16 intr)
|
|
|
{
|
|
@@ -954,30 +874,6 @@ u32 vnic_dev_mtu(struct vnic_dev *vdev)
|
|
|
return vdev->notify_copy.mtu;
|
|
|
}
|
|
|
|
|
|
-u32 vnic_dev_link_down_cnt(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- if (!vnic_dev_notify_ready(vdev))
|
|
|
- return 0;
|
|
|
-
|
|
|
- return vdev->notify_copy.link_down_cnt;
|
|
|
-}
|
|
|
-
|
|
|
-u32 vnic_dev_notify_status(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- if (!vnic_dev_notify_ready(vdev))
|
|
|
- return 0;
|
|
|
-
|
|
|
- return vdev->notify_copy.status;
|
|
|
-}
|
|
|
-
|
|
|
-u32 vnic_dev_uif(struct vnic_dev *vdev)
|
|
|
-{
|
|
|
- if (!vnic_dev_notify_ready(vdev))
|
|
|
- return 0;
|
|
|
-
|
|
|
- return vdev->notify_copy.uif;
|
|
|
-}
|
|
|
-
|
|
|
void vnic_dev_set_intr_mode(struct vnic_dev *vdev,
|
|
|
enum vnic_dev_intr_mode intr_mode)
|
|
|
{
|