Skip to content

Commit

Permalink
enic: changes to driver/firmware interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Feldman authored and David S. Miller committed Sep 4, 2009
1 parent 9f63a7c commit d73149f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
14 changes: 14 additions & 0 deletions drivers/net/enic/vnic_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,20 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, 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)
printk(KERN_ERR "Failed to raise INTR[%d], err %d\n",
intr, err);

return err;
}

int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)
{
u64 a0, a1;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/enic/vnic_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr);
void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr);
int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr);
int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr);
int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr);
void vnic_dev_notify_unset(struct vnic_dev *vdev);
int vnic_dev_link_status(struct vnic_dev *vdev);
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/enic/vnic_devcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ enum vnic_devcmd_cmd {
CMD_MAC_ADDR = _CMDC(_CMD_DIR_READ,
_CMD_VTYPE_ENET | _CMD_VTYPE_FC, 9),

/* disable/enable promisc mode: (u8)a0=0/1 */
/***** XXX DEPRECATED *****/
CMD_PROMISC_MODE = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 10),

/* disable/enable all-multi mode: (u8)a0=0/1 */
/***** XXX DEPRECATED *****/
CMD_ALLMULTI_MODE = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 11),

/* add addr from (u48)a0 */
CMD_ADDR_ADD = _CMDCNW(_CMD_DIR_WRITE,
_CMD_VTYPE_ENET | _CMD_VTYPE_FC, 12),
Expand Down Expand Up @@ -182,7 +174,9 @@ enum vnic_devcmd_cmd {
/* disable virtual link */
CMD_DISABLE = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_ALL, 29),

/* stats dump all vnics on uplink in mem: (u64)a0=paddr (u32)a1=uif */
/* stats dump sum of all vnic stats on same uplink in mem:
* (u64)a0=paddr
* (u16)a1=sizeof stats area */
CMD_STATS_DUMP_ALL = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 30),

/* init status:
Expand Down Expand Up @@ -211,7 +205,12 @@ enum vnic_devcmd_cmd {
/* persistent binding info
* in: (u64)a0=paddr of arg
* (u32)a1=CMD_PERBI_XXX */
CMD_PERBI = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_FC, 37),
CMD_PERBI = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_FC, 37),

/* Interrupt Assert Register functionality
* in: (u16)a0=interrupt number to assert
*/
CMD_IAR = _CMDCNW(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 38),
};

/* flags for CMD_OPEN */
Expand Down Expand Up @@ -244,6 +243,7 @@ enum vnic_devcmd_error {
ERR_ENOMEM = 7,
ERR_ETIMEDOUT = 8,
ERR_ELINKDOWN = 9,
ERR_EMAXRES = 10,
};

struct vnic_devcmd_fw_info {
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/enic/vnic_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ void vnic_intr_clean(struct vnic_intr *intr)
{
iowrite32(0, &intr->ctrl->int_credits);
}

void vnic_intr_raise(struct vnic_intr *intr)
{
vnic_dev_raise_intr(intr->vdev, (u16)intr->index);
}

0 comments on commit d73149f

Please sign in to comment.