Skip to content

Commit

Permalink
Merge branch 'qlcnic'
Browse files Browse the repository at this point in the history
Himanshu Madhani says:

====================
This series contains following patches

o in v2 series, we received feedback on return codes to use standard error
  codes instead of mixing custom error codes. We have modified patch for
  loopback diagnostic test to return standard error codes.

o rest of the 3 patches in the series are for mailbox refactoring

  Current driver-firmware mailbox interface was operating in polling mode
  because of some limitations with the earlier versions of 83xx adapter
  firmware. These issues are resolved now and we are implementing the
  mailbox interface in interrupt mode.

  There are three patches which refactors mailbox handling:
  * Interrupt mode mailbox implantation.
  * Replace poll mode mailbox interfaces with interrupt mode interfaces.
  * Operate mailbox in poll mode when interrupts are not available.

changes from v2 -> v3
 * Addressed review feedback to use standard return codes for loopback
   diagnostic test.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 2, 2013
2 parents a594e4f + 3753456 commit bd3f543
Show file tree
Hide file tree
Showing 8 changed files with 651 additions and 309 deletions.
59 changes: 46 additions & 13 deletions drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/firmware.h>

#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/timer.h>
Expand All @@ -38,8 +37,8 @@

#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 2
#define _QLCNIC_LINUX_SUBVERSION 44
#define QLCNIC_LINUX_VERSIONID "5.2.44"
#define _QLCNIC_LINUX_SUBVERSION 45
#define QLCNIC_LINUX_VERSIONID "5.2.45"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
Expand Down Expand Up @@ -467,7 +466,7 @@ struct qlcnic_hardware_context {
u32 *ext_reg_tbl;
u32 mbox_aen[QLC_83XX_MBX_AEN_CNT];
u32 mbox_reg[4];
spinlock_t mbx_lock;
struct qlcnic_mailbox *mailbox;
};

struct qlcnic_adapter_stats {
Expand Down Expand Up @@ -950,12 +949,6 @@ struct qlcnic_ipaddr {
#define QLCNIC_READD_AGE 20
#define QLCNIC_LB_MAX_FILTERS 64
#define QLCNIC_LB_BUCKET_SIZE 32

/* QLCNIC Driver Error Code */
#define QLCNIC_FW_NOT_RESPOND 51
#define QLCNIC_TEST_IN_PROGRESS 52
#define QLCNIC_UNDEFINED_ERROR 53
#define QLCNIC_LB_CABLE_NOT_CONN 54
#define QLCNIC_ILB_MAX_RCV_LOOP 10

struct qlcnic_filter {
Expand All @@ -972,6 +965,21 @@ struct qlcnic_filter_hash {
u16 fbucket_size;
};

/* Mailbox specific data structures */
struct qlcnic_mailbox {
struct workqueue_struct *work_q;
struct qlcnic_adapter *adapter;
struct qlcnic_mbx_ops *ops;
struct work_struct work;
struct completion completion;
struct list_head cmd_q;
unsigned long status;
spinlock_t queue_lock; /* Mailbox queue lock */
spinlock_t aen_lock; /* Mailbox response/AEN lock */
atomic_t rsp_status;
u32 num_cmds;
};

struct qlcnic_adapter {
struct qlcnic_hardware_context *ahw;
struct qlcnic_recv_context *recv_ctx;
Expand Down Expand Up @@ -1385,9 +1393,20 @@ struct _cdrp_cmd {
};

struct qlcnic_cmd_args {
struct _cdrp_cmd req;
struct _cdrp_cmd rsp;
int op_type;
struct completion completion;
struct list_head list;
struct _cdrp_cmd req;
struct _cdrp_cmd rsp;
atomic_t rsp_status;
int pay_size;
u32 rsp_opcode;
u32 total_cmds;
u32 op_type;
u32 type;
u32 cmd_op;
u32 *hdr; /* Back channel message header */
u32 *pay; /* Back channel message payload */
u8 func_num;
};

int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter);
Expand Down Expand Up @@ -1600,6 +1619,20 @@ struct qlcnic_nic_template {
int (*resume)(struct qlcnic_adapter *);
};

struct qlcnic_mbx_ops {
int (*enqueue_cmd) (struct qlcnic_adapter *,
struct qlcnic_cmd_args *, unsigned long *);
void (*dequeue_cmd) (struct qlcnic_adapter *, struct qlcnic_cmd_args *);
void (*decode_resp) (struct qlcnic_adapter *, struct qlcnic_cmd_args *);
void (*encode_cmd) (struct qlcnic_adapter *, struct qlcnic_cmd_args *);
void (*nofity_fw) (struct qlcnic_adapter *, u8);
};

int qlcnic_83xx_init_mailbox_work(struct qlcnic_adapter *);
void qlcnic_83xx_detach_mailbox_work(struct qlcnic_adapter *);
void qlcnic_83xx_reinit_mbx_work(struct qlcnic_mailbox *mbx);
void qlcnic_83xx_free_mailbox(struct qlcnic_mailbox *mbx);

/* Adapter hardware abstraction */
struct qlcnic_hardware_ops {
void (*read_crb) (struct qlcnic_adapter *, char *, loff_t, size_t);
Expand Down
Loading

0 comments on commit bd3f543

Please sign in to comment.