Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd3f5433 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'qlcnic'



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: default avatarDavid S. Miller <davem@davemloft.net>
parents a594e4f8 37534567
Loading
Loading
Loading
Loading
+46 −13
Original line number Original line Diff line number Diff line
@@ -20,7 +20,6 @@
#include <linux/tcp.h>
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/firmware.h>
#include <linux/firmware.h>

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


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


struct qlcnic_adapter_stats {
struct qlcnic_adapter_stats {
@@ -950,12 +949,6 @@ struct qlcnic_ipaddr {
#define QLCNIC_READD_AGE	20
#define QLCNIC_READD_AGE	20
#define QLCNIC_LB_MAX_FILTERS	64
#define QLCNIC_LB_MAX_FILTERS	64
#define QLCNIC_LB_BUCKET_SIZE	32
#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
#define QLCNIC_ILB_MAX_RCV_LOOP	10


struct qlcnic_filter {
struct qlcnic_filter {
@@ -972,6 +965,21 @@ struct qlcnic_filter_hash {
	u16 fbucket_size;
	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_adapter {
	struct qlcnic_hardware_context *ahw;
	struct qlcnic_hardware_context *ahw;
	struct qlcnic_recv_context *recv_ctx;
	struct qlcnic_recv_context *recv_ctx;
@@ -1385,9 +1393,20 @@ struct _cdrp_cmd {
};
};


struct qlcnic_cmd_args {
struct qlcnic_cmd_args {
	struct completion	completion;
	struct list_head	list;
	struct _cdrp_cmd	req;
	struct _cdrp_cmd	req;
	struct _cdrp_cmd	rsp;
	struct _cdrp_cmd	rsp;
	int op_type;
	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);
int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter);
@@ -1600,6 +1619,20 @@ struct qlcnic_nic_template {
	int (*resume)(struct qlcnic_adapter *);
	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 */
/* Adapter hardware abstraction */
struct qlcnic_hardware_ops {
struct qlcnic_hardware_ops {
	void (*read_crb) (struct qlcnic_adapter *, char *, loff_t, size_t);
	void (*read_crb) (struct qlcnic_adapter *, char *, loff_t, size_t);
Loading