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

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

Merge branch 'qlcnic-next'



Shahed Shaikh says:

====================
qlcnic: Re-factoring and enhancements

This patch series includes following changes -
* Re-factored firmware minidump template header handling
* Support to make 8 vNIC mode application to work with 16 vNIC mode
* Enhance error message logging when adapter is in failed state and
  when adapter lock access fails.
* Allow vlan0 traffic
* update MAINTAINERS

Please apply this series to net-next.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a1991c74 e6b0b019
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -7038,13 +7038,8 @@ F: Documentation/networking/LICENSE.qla3xxx
F:	drivers/net/ethernet/qlogic/qla3xxx.*
F:	drivers/net/ethernet/qlogic/qla3xxx.*


QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
M:	Himanshu Madhani <himanshu.madhani@qlogic.com>
M:	Rajesh Borundia <rajesh.borundia@qlogic.com>
M:	Shahed Shaikh <shahed.shaikh@qlogic.com>
M:	Shahed Shaikh <shahed.shaikh@qlogic.com>
M:	Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
M:	Dept-HSGLinuxNICDev@qlogic.com
M:	Sony Chacko <sony.chacko@qlogic.com>
M:	Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
M:	linux-driver@qlogic.com
L:	netdev@vger.kernel.org
L:	netdev@vger.kernel.org
S:	Supported
S:	Supported
F:	drivers/net/ethernet/qlogic/qlcnic/
F:	drivers/net/ethernet/qlogic/qlcnic/
+73 −4
Original line number Original line Diff line number Diff line
@@ -38,8 +38,8 @@


#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 3
#define _QLCNIC_LINUX_MINOR 3
#define _QLCNIC_LINUX_SUBVERSION 55
#define _QLCNIC_LINUX_SUBVERSION 56
#define QLCNIC_LINUX_VERSIONID  "5.3.55"
#define QLCNIC_LINUX_VERSIONID  "5.3.56"
#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))
@@ -394,7 +394,7 @@ struct qlcnic_nic_intr_coalesce {
	u32	timer_out;
	u32	timer_out;
};
};


struct qlcnic_dump_template_hdr {
struct qlcnic_83xx_dump_template_hdr {
	u32	type;
	u32	type;
	u32	offset;
	u32	offset;
	u32	size;
	u32	size;
@@ -411,15 +411,42 @@ struct qlcnic_dump_template_hdr {
	u32	rsvd[0];
	u32	rsvd[0];
};
};


struct qlcnic_82xx_dump_template_hdr {
	u32	type;
	u32	offset;
	u32	size;
	u32	cap_mask;
	u32	num_entries;
	u32	version;
	u32	timestamp;
	u32	checksum;
	u32	drv_cap_mask;
	u32	sys_info[3];
	u32	saved_state[16];
	u32	cap_sizes[8];
	u32	rsvd[7];
	u32	capabilities;
	u32	rsvd1[0];
};

struct qlcnic_fw_dump {
struct qlcnic_fw_dump {
	u8	clr;	/* flag to indicate if dump is cleared */
	u8	clr;	/* flag to indicate if dump is cleared */
	bool	enable; /* enable/disable dump */
	bool	enable; /* enable/disable dump */
	u32	size;	/* total size of the dump */
	u32	size;	/* total size of the dump */
	u32	cap_mask; /* Current capture mask */
	void	*data;	/* dump data area */
	void	*data;	/* dump data area */
	struct	qlcnic_dump_template_hdr *tmpl_hdr;
	void	*tmpl_hdr;
	dma_addr_t phys_addr;
	dma_addr_t phys_addr;
	void	*dma_buffer;
	void	*dma_buffer;
	bool	use_pex_dma;
	bool	use_pex_dma;
	/* Read only elements which are common between 82xx and 83xx
	 * template header. Update these values immediately after we read
	 * template header from Firmware
	 */
	u32	tmpl_hdr_size;
	u32	version;
	u32	num_entries;
	u32	offset;
};
};


/*
/*
@@ -1769,6 +1796,12 @@ struct qlcnic_hardware_ops {
				struct qlcnic_host_tx_ring *);
				struct qlcnic_host_tx_ring *);
	void (*disable_tx_intr) (struct qlcnic_adapter *,
	void (*disable_tx_intr) (struct qlcnic_adapter *,
				 struct qlcnic_host_tx_ring *);
				 struct qlcnic_host_tx_ring *);
	u32 (*get_saved_state)(void *, u32);
	void (*set_saved_state)(void *, u32, u32);
	void (*cache_tmpl_hdr_values)(struct qlcnic_fw_dump *);
	u32 (*get_cap_size)(void *, int);
	void (*set_sys_info)(void *, int, u32);
	void (*store_cap_mask)(void *, u32);
};
};


extern struct qlcnic_nic_template qlcnic_vf_ops;
extern struct qlcnic_nic_template qlcnic_vf_ops;
@@ -2007,6 +2040,42 @@ static inline void qlcnic_read_phys_port_id(struct qlcnic_adapter *adapter)
		adapter->ahw->hw_ops->read_phys_port_id(adapter);
		adapter->ahw->hw_ops->read_phys_port_id(adapter);
}
}


static inline u32 qlcnic_get_saved_state(struct qlcnic_adapter *adapter,
					 void *t_hdr, u32 index)
{
	return adapter->ahw->hw_ops->get_saved_state(t_hdr, index);
}

static inline void qlcnic_set_saved_state(struct qlcnic_adapter *adapter,
					  void *t_hdr, u32 index, u32 value)
{
	adapter->ahw->hw_ops->set_saved_state(t_hdr, index, value);
}

static inline void qlcnic_cache_tmpl_hdr_values(struct qlcnic_adapter *adapter,
						struct qlcnic_fw_dump *fw_dump)
{
	adapter->ahw->hw_ops->cache_tmpl_hdr_values(fw_dump);
}

static inline u32 qlcnic_get_cap_size(struct qlcnic_adapter *adapter,
				      void *tmpl_hdr, int index)
{
	return adapter->ahw->hw_ops->get_cap_size(tmpl_hdr, index);
}

static inline void qlcnic_set_sys_info(struct qlcnic_adapter *adapter,
				       void *tmpl_hdr, int idx, u32 value)
{
	adapter->ahw->hw_ops->set_sys_info(tmpl_hdr, idx, value);
}

static inline void qlcnic_store_cap_mask(struct qlcnic_adapter *adapter,
					 void *tmpl_hdr, u32 mask)
{
	adapter->ahw->hw_ops->store_cap_mask(tmpl_hdr, mask);
}

static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter,
static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter,
					    u32 key)
					    u32 key)
{
{
+6 −1
Original line number Original line Diff line number Diff line
@@ -203,7 +203,12 @@ static struct qlcnic_hardware_ops qlcnic_83xx_hw_ops = {
	.disable_sds_intr		= qlcnic_83xx_disable_sds_intr,
	.disable_sds_intr		= qlcnic_83xx_disable_sds_intr,
	.enable_tx_intr			= qlcnic_83xx_enable_tx_intr,
	.enable_tx_intr			= qlcnic_83xx_enable_tx_intr,
	.disable_tx_intr		= qlcnic_83xx_disable_tx_intr,
	.disable_tx_intr		= qlcnic_83xx_disable_tx_intr,

	.get_saved_state		= qlcnic_83xx_get_saved_state,
	.set_saved_state		= qlcnic_83xx_set_saved_state,
	.cache_tmpl_hdr_values		= qlcnic_83xx_cache_tmpl_hdr_values,
	.get_cap_size			= qlcnic_83xx_get_cap_size,
	.set_sys_info			= qlcnic_83xx_set_sys_info,
	.store_cap_mask			= qlcnic_83xx_store_cap_mask,
};
};


static struct qlcnic_nic_template qlcnic_83xx_ops = {
static struct qlcnic_nic_template qlcnic_83xx_ops = {
+8 −0
Original line number Original line Diff line number Diff line
@@ -308,6 +308,8 @@ struct qlc_83xx_reset {
#define QLC_83XX_IDC_FLASH_PARAM_ADDR			0x3e8020
#define QLC_83XX_IDC_FLASH_PARAM_ADDR			0x3e8020


struct qlcnic_adapter;
struct qlcnic_adapter;
struct qlcnic_fw_dump;

struct qlc_83xx_idc {
struct qlc_83xx_idc {
	int (*state_entry) (struct qlcnic_adapter *);
	int (*state_entry) (struct qlcnic_adapter *);
	u64		sec_counter;
	u64		sec_counter;
@@ -650,4 +652,10 @@ int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *);
void qlcnic_83xx_aer_stop_poll_work(struct qlcnic_adapter *);
void qlcnic_83xx_aer_stop_poll_work(struct qlcnic_adapter *);
int qlcnic_83xx_aer_reset(struct qlcnic_adapter *);
int qlcnic_83xx_aer_reset(struct qlcnic_adapter *);
void qlcnic_83xx_aer_start_poll_work(struct qlcnic_adapter *);
void qlcnic_83xx_aer_start_poll_work(struct qlcnic_adapter *);
u32 qlcnic_83xx_get_saved_state(void *, u32);
void qlcnic_83xx_set_saved_state(void *, u32, u32);
void qlcnic_83xx_cache_tmpl_hdr_values(struct qlcnic_fw_dump *);
u32 qlcnic_83xx_get_cap_size(void *, int);
void qlcnic_83xx_set_sys_info(void *, int, u32);
void qlcnic_83xx_store_cap_mask(void *, u32);
#endif
#endif
+11 −6
Original line number Original line Diff line number Diff line
@@ -1639,14 +1639,14 @@ qlcnic_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump)
	}
	}


	if (fw_dump->clr)
	if (fw_dump->clr)
		dump->len = fw_dump->tmpl_hdr->size + fw_dump->size;
		dump->len = fw_dump->tmpl_hdr_size + fw_dump->size;
	else
	else
		dump->len = 0;
		dump->len = 0;


	if (!qlcnic_check_fw_dump_state(adapter))
	if (!qlcnic_check_fw_dump_state(adapter))
		dump->flag = ETH_FW_DUMP_DISABLE;
		dump->flag = ETH_FW_DUMP_DISABLE;
	else
	else
		dump->flag = fw_dump->tmpl_hdr->drv_cap_mask;
		dump->flag = fw_dump->cap_mask;


	dump->version = adapter->fw_version;
	dump->version = adapter->fw_version;
	return 0;
	return 0;
@@ -1671,8 +1671,9 @@ qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
		netdev_info(netdev, "Dump not available\n");
		netdev_info(netdev, "Dump not available\n");
		return -EINVAL;
		return -EINVAL;
	}
	}

	/* Copy template header first */
	/* Copy template header first */
	copy_sz = fw_dump->tmpl_hdr->size;
	copy_sz = fw_dump->tmpl_hdr_size;
	hdr_ptr = (u32 *)fw_dump->tmpl_hdr;
	hdr_ptr = (u32 *)fw_dump->tmpl_hdr;
	data = buffer;
	data = buffer;
	for (i = 0; i < copy_sz/sizeof(u32); i++)
	for (i = 0; i < copy_sz/sizeof(u32); i++)
@@ -1681,7 +1682,7 @@ qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump,
	/* Copy captured dump data */
	/* Copy captured dump data */
	memcpy(buffer + copy_sz, fw_dump->data, fw_dump->size);
	memcpy(buffer + copy_sz, fw_dump->data, fw_dump->size);
	dump->len = copy_sz + fw_dump->size;
	dump->len = copy_sz + fw_dump->size;
	dump->flag = fw_dump->tmpl_hdr->drv_cap_mask;
	dump->flag = fw_dump->cap_mask;


	/* Free dump area once data has been captured */
	/* Free dump area once data has been captured */
	vfree(fw_dump->data);
	vfree(fw_dump->data);
@@ -1703,7 +1704,11 @@ static int qlcnic_set_dump_mask(struct qlcnic_adapter *adapter, u32 mask)
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;
	}
	}


	fw_dump->tmpl_hdr->drv_cap_mask = mask;
	fw_dump->cap_mask = mask;

	/* Store new capture mask in template header as well*/
	qlcnic_store_cap_mask(adapter, fw_dump->tmpl_hdr, mask);

	netdev_info(netdev, "Driver mask changed to: 0x%x\n", mask);
	netdev_info(netdev, "Driver mask changed to: 0x%x\n", mask);
	return 0;
	return 0;
}
}
Loading