Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341856
b: refs/heads/master
c: 7978845
h: refs/heads/master
v: v3
  • Loading branch information
Sony Chacko authored and David S. Miller committed Dec 4, 2012
1 parent 1649d9e commit 40fe907
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 174 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97ee45eb099a9a0f1dc992f98e9476cc159ee5e0
refs/heads/master: 797884509d1f7dffa4fd1028a1f62a19705a518b
67 changes: 34 additions & 33 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,41 @@ struct qlcnic_hardware_context {
u8 pci_func;
u8 linkup;
u8 loopback_state;
u8 beacon_state;
u8 has_link_events;
u8 fw_type;
u8 physical_port;
u8 reset_context;
u8 msix_supported;
u8 max_mac_filters;
u8 mc_enabled;
u8 max_mc_count;
u8 diag_test;
u8 num_msix;
u8 nic_mode;
char diag_cnt;

u16 port_type;
u16 board_type;

u8 beacon_state;
u16 link_speed;
u16 link_duplex;
u16 link_autoneg;
u16 module_type;

u16 op_mode;
u16 switch_mode;
u16 max_tx_ques;
u16 max_rx_ques;
u16 max_mtu;
u32 msg_enable;
u16 act_pci_func;

u32 capabilities;
u32 temp;
u32 int_vec_bit;
u32 fw_hal_version;
struct qlcnic_hardware_ops *hw_ops;
struct qlcnic_nic_intr_coalesce coal;
struct qlcnic_fw_dump fw_dump;
};
Expand Down Expand Up @@ -430,6 +460,7 @@ struct qlcnic_host_sds_ring {
} ____cacheline_internodealigned_in_smp;

struct qlcnic_host_tx_ring {
u16 ctx_id;
u32 producer;
u32 sw_consumer;
u32 num_desc;
Expand Down Expand Up @@ -894,6 +925,7 @@ struct qlcnic_adapter {
unsigned long state;
u32 flags;

int max_drv_tx_rings;
u16 num_txd;
u16 num_rxd;
u16 num_jumbo_rxd;
Expand All @@ -902,57 +934,28 @@ struct qlcnic_adapter {

u8 max_rds_rings;
u8 max_sds_rings;
u8 msix_supported;
u8 portnum;
u8 physical_port;
u8 reset_context;

u8 mc_enabled;
u8 max_mc_count;
u8 fw_wait_cnt;
u8 fw_fail_cnt;
u8 tx_timeo_cnt;
u8 need_fw_reset;

u8 has_link_events;
u8 fw_type;
u16 tx_context_id;
u16 is_up;

u16 link_speed;
u16 link_duplex;
u16 link_autoneg;
u16 module_type;

u16 op_mode;
u16 switch_mode;
u16 max_tx_ques;
u16 max_rx_ques;
u16 max_mtu;
u16 pvid;

u32 fw_hal_version;
u32 capabilities;
u32 irq;
u32 temp;

u32 int_vec_bit;
u32 heartbeat;

u8 max_mac_filters;
u8 dev_state;
u8 diag_test;
char diag_cnt;
u8 reset_ack_timeo;
u8 dev_init_timeo;
u16 msg_enable;

u8 mac_addr[ETH_ALEN];

u64 dev_rst_time;
u8 mac_learn;
unsigned long vlans[BITS_TO_LONGS(VLAN_N_VID)];

struct qlcnic_npar_info *npars;
struct qlcnic_eswitch *eswitch;
struct qlcnic_nic_template *nic_ops;
Expand All @@ -966,10 +969,8 @@ struct qlcnic_adapter {
void __iomem *isr_int_vec;

struct msix_entry *msix_entries;

struct delayed_work fw_work;


struct qlcnic_filter_hash fhash;

spinlock_t tx_clean_lock;
Expand Down Expand Up @@ -1509,7 +1510,7 @@ struct qlcnic_nic_template {
};

#define QLCDB(adapter, lvl, _fmt, _args...) do { \
if (NETIF_MSG_##lvl & adapter->msg_enable) \
if (NETIF_MSG_##lvl & adapter->ahw->msg_enable) \
printk(KERN_INFO "%s: %s: " _fmt, \
dev_name(&adapter->pdev->dev), \
__func__, ##_args); \
Expand Down
29 changes: 14 additions & 15 deletions trunk/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)
struct qlcnic_hardware_context *ahw = adapter->ahw;

signature = QLCNIC_CDRP_SIGNATURE_MAKE(ahw->pci_func,
adapter->fw_hal_version);
adapter->ahw->fw_hal_version);

/* Acquire semaphore before accessing CRB */
if (qlcnic_api_lock(adapter)) {
Expand Down Expand Up @@ -455,8 +455,7 @@ qlcnic_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter)
temp = le32_to_cpu(prsp->cds_ring.host_producer_crb);
tx_ring->crb_cmd_producer = adapter->ahw->pci_base0 + temp;

adapter->tx_context_id =
le16_to_cpu(prsp->context_id);
adapter->tx_ring->ctx_id = le16_to_cpu(prsp->context_id);
} else {
dev_err(&adapter->pdev->dev,
"Failed to create tx ctx in firmware%d\n", err);
Expand All @@ -478,7 +477,7 @@ qlcnic_fw_cmd_destroy_tx_ctx(struct qlcnic_adapter *adapter)
struct qlcnic_cmd_args cmd;

memset(&cmd, 0, sizeof(cmd));
cmd.req.arg1 = adapter->tx_context_id;
cmd.req.arg1 = adapter->tx_ring->ctx_id;
cmd.req.arg2 = QLCNIC_DESTROY_CTX_RESET;
cmd.req.arg3 = 0;
cmd.req.cmd = QLCNIC_CDRP_CMD_DESTROY_TX_CTX;
Expand Down Expand Up @@ -750,7 +749,7 @@ int qlcnic_set_nic_info(struct qlcnic_adapter *adapter, struct qlcnic_info *nic)
struct qlcnic_info_le *nic_info;
size_t nic_size = sizeof(struct qlcnic_info_le);

if (adapter->op_mode != QLCNIC_MGMT_FUNC)
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
return err;

nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
Expand Down Expand Up @@ -850,8 +849,8 @@ int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id,
u32 arg1;
struct qlcnic_cmd_args cmd;

if (adapter->op_mode != QLCNIC_MGMT_FUNC ||
!(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE))
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC ||
!(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE))
return err;

arg1 = id | (enable_mirroring ? BIT_4 : 0);
Expand Down Expand Up @@ -890,8 +889,8 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
if (esw_stats == NULL)
return -ENOMEM;

if (adapter->op_mode != QLCNIC_MGMT_FUNC &&
func != adapter->ahw->pci_func) {
if ((adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) &&
(func != adapter->ahw->pci_func)) {
dev_err(&adapter->pdev->dev,
"Not privilege to query stats for func=%d", func);
return -EIO;
Expand Down Expand Up @@ -1002,7 +1001,7 @@ int qlcnic_get_eswitch_stats(struct qlcnic_adapter *adapter, const u8 eswitch,

if (esw_stats == NULL)
return -ENOMEM;
if (adapter->op_mode != QLCNIC_MGMT_FUNC)
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
return -EIO;
if (adapter->npars == NULL)
return -EIO;
Expand Down Expand Up @@ -1053,7 +1052,7 @@ int qlcnic_clear_esw_stats(struct qlcnic_adapter *adapter, const u8 func_esw,
u32 arg1;
struct qlcnic_cmd_args cmd;

if (adapter->op_mode != QLCNIC_MGMT_FUNC)
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
return -EIO;

if (func_esw == QLCNIC_STATS_PORT) {
Expand Down Expand Up @@ -1126,7 +1125,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
struct qlcnic_cmd_args cmd;
u8 pci_func;

if (adapter->op_mode != QLCNIC_MGMT_FUNC)
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
return err;
pci_func = esw_cfg->pci_func;
arg1 = (adapter->npars[pci_func].phy_port & BIT_0);
Expand All @@ -1141,7 +1140,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
case QLCNIC_PORT_DEFAULTS:
arg1 |= (BIT_4 | BIT_6 | BIT_7);
arg2 |= (BIT_0 | BIT_1);
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO)
if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
arg2 |= (BIT_2 | BIT_3);
if (!(esw_cfg->discard_tagged))
arg1 &= ~BIT_4;
Expand Down Expand Up @@ -1194,10 +1193,10 @@ qlcnic_get_eswitch_port_config(struct qlcnic_adapter *adapter,
{
u32 arg1, arg2;
u8 phy_port;
if (adapter->op_mode == QLCNIC_MGMT_FUNC)
if (adapter->ahw->op_mode == QLCNIC_MGMT_FUNC)
phy_port = adapter->npars[esw_cfg->pci_func].phy_port;
else
phy_port = adapter->physical_port;
phy_port = adapter->ahw->physical_port;
arg1 = phy_port;
arg1 |= (esw_cfg->pci_func << 8);
if (__qlcnic_get_eswitch_port_config(adapter, &arg1, &arg2))
Expand Down
Loading

0 comments on commit 40fe907

Please sign in to comment.