aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic
diff options
context:
space:
mode:
authorScott Feldman <scofeldm@cisco.com>2009-09-03 13:02:35 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-03 23:19:23 -0400
commitd73149f51e165f5872bc431ae181650396145265 (patch)
treef737b65590919989546fdea996e76407e67b14d8 /drivers/net/enic
parent9f63a7c6aef00a8eafa7521342099f199f68c575 (diff)
enic: changes to driver/firmware interface
Deprecate some old APIa; change arguments to stats dump all API; add new interrupt assert API Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r--drivers/net/enic/vnic_dev.c14
-rw-r--r--drivers/net/enic/vnic_dev.h1
-rw-r--r--drivers/net/enic/vnic_devcmd.h20
-rw-r--r--drivers/net/enic/vnic_intr.c5
4 files changed, 30 insertions, 10 deletions
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c
index c8d3fc7517b0..29a48e8b59d3 100644
--- a/drivers/net/enic/vnic_dev.c
+++ b/drivers/net/enic/vnic_dev.c
@@ -560,6 +560,20 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
560 printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err); 560 printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err);
561} 561}
562 562
563int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr)
564{
565 u64 a0 = intr, a1 = 0;
566 int wait = 1000;
567 int err;
568
569 err = vnic_dev_cmd(vdev, CMD_IAR, &a0, &a1, wait);
570 if (err)
571 printk(KERN_ERR "Failed to raise INTR[%d], err %d\n",
572 intr, err);
573
574 return err;
575}
576
563int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) 577int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)
564{ 578{
565 u64 a0, a1; 579 u64 a0, a1;
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h
index db1d63e0b97c..fc5e3eb35a5e 100644
--- a/drivers/net/enic/vnic_dev.h
+++ b/drivers/net/enic/vnic_dev.h
@@ -106,6 +106,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
106void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr); 106void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr);
107void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr); 107void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr);
108int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr); 108int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr);
109int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr);
109int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr); 110int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr);
110void vnic_dev_notify_unset(struct vnic_dev *vdev); 111void vnic_dev_notify_unset(struct vnic_dev *vdev);
111int vnic_dev_link_status(struct vnic_dev *vdev); 112int vnic_dev_link_status(struct vnic_dev *vdev);
diff --git a/drivers/net/enic/vnic_devcmd.h b/drivers/net/enic/vnic_devcmd.h
index 2587f34fbfbd..d78bbcc1fdf9 100644
--- a/drivers/net/enic/vnic_devcmd.h
+++ b/drivers/net/enic/vnic_devcmd.h
@@ -105,14 +105,6 @@ enum vnic_devcmd_cmd {
105 CMD_MAC_ADDR = _CMDC(_CMD_DIR_READ, 105 CMD_MAC_ADDR = _CMDC(_CMD_DIR_READ,
106 _CMD_VTYPE_ENET | _CMD_VTYPE_FC, 9), 106 _CMD_VTYPE_ENET | _CMD_VTYPE_FC, 9),
107 107
108 /* disable/enable promisc mode: (u8)a0=0/1 */
109/***** XXX DEPRECATED *****/
110 CMD_PROMISC_MODE = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 10),
111
112 /* disable/enable all-multi mode: (u8)a0=0/1 */
113/***** XXX DEPRECATED *****/
114 CMD_ALLMULTI_MODE = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 11),
115
116 /* add addr from (u48)a0 */ 108 /* add addr from (u48)a0 */
117 CMD_ADDR_ADD = _CMDCNW(_CMD_DIR_WRITE, 109 CMD_ADDR_ADD = _CMDCNW(_CMD_DIR_WRITE,
118 _CMD_VTYPE_ENET | _CMD_VTYPE_FC, 12), 110 _CMD_VTYPE_ENET | _CMD_VTYPE_FC, 12),
@@ -182,7 +174,9 @@ enum vnic_devcmd_cmd {
182 /* disable virtual link */ 174 /* disable virtual link */
183 CMD_DISABLE = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_ALL, 29), 175 CMD_DISABLE = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_ALL, 29),
184 176
185 /* stats dump all vnics on uplink in mem: (u64)a0=paddr (u32)a1=uif */ 177 /* stats dump sum of all vnic stats on same uplink in mem:
178 * (u64)a0=paddr
179 * (u16)a1=sizeof stats area */
186 CMD_STATS_DUMP_ALL = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 30), 180 CMD_STATS_DUMP_ALL = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 30),
187 181
188 /* init status: 182 /* init status:
@@ -211,7 +205,12 @@ enum vnic_devcmd_cmd {
211 /* persistent binding info 205 /* persistent binding info
212 * in: (u64)a0=paddr of arg 206 * in: (u64)a0=paddr of arg
213 * (u32)a1=CMD_PERBI_XXX */ 207 * (u32)a1=CMD_PERBI_XXX */
214 CMD_PERBI = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_FC, 37), 208 CMD_PERBI = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_FC, 37),
209
210 /* Interrupt Assert Register functionality
211 * in: (u16)a0=interrupt number to assert
212 */
213 CMD_IAR = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 38),
215}; 214};
216 215
217/* flags for CMD_OPEN */ 216/* flags for CMD_OPEN */
@@ -244,6 +243,7 @@ enum vnic_devcmd_error {
244 ERR_ENOMEM = 7, 243 ERR_ENOMEM = 7,
245 ERR_ETIMEDOUT = 8, 244 ERR_ETIMEDOUT = 8,
246 ERR_ELINKDOWN = 9, 245 ERR_ELINKDOWN = 9,
246 ERR_EMAXRES = 10,
247}; 247};
248 248
249struct vnic_devcmd_fw_info { 249struct vnic_devcmd_fw_info {
diff --git a/drivers/net/enic/vnic_intr.c b/drivers/net/enic/vnic_intr.c
index ddc38f8f4656..1f8786d7195e 100644
--- a/drivers/net/enic/vnic_intr.c
+++ b/drivers/net/enic/vnic_intr.c
@@ -60,3 +60,8 @@ void vnic_intr_clean(struct vnic_intr *intr)
60{ 60{
61 iowrite32(0, &intr->ctrl->int_credits); 61 iowrite32(0, &intr->ctrl->int_credits);
62} 62}
63
64void vnic_intr_raise(struct vnic_intr *intr)
65{
66 vnic_dev_raise_intr(intr->vdev, (u16)intr->index);
67}