Lines Matching refs:adapter

10 static int qlcnic_83xx_enable_vnic_mode(struct qlcnic_adapter *adapter, int lock)
13 if (qlcnic_83xx_lock_driver(adapter))
16 QLCWRX(adapter->ahw, QLC_83XX_VNIC_STATE, QLCNIC_DEV_NPAR_OPER);
18 qlcnic_83xx_unlock_driver(adapter);
23 int qlcnic_83xx_disable_vnic_mode(struct qlcnic_adapter *adapter, int lock)
25 struct qlcnic_hardware_context *ahw = adapter->ahw;
28 if (qlcnic_83xx_lock_driver(adapter))
32 QLCWRX(adapter->ahw, QLC_83XX_VNIC_STATE, QLCNIC_DEV_NPAR_NON_OPER);
36 qlcnic_83xx_unlock_driver(adapter);
41 int qlcnic_83xx_set_vnic_opmode(struct qlcnic_adapter *adapter)
46 struct qlcnic_hardware_context *ahw = adapter->ahw;
48 if (qlcnic_83xx_lock_driver(adapter))
52 data = QLCRDX(adapter->ahw, QLC_83XX_DRV_OP_MODE);
56 QLCWRX(adapter->ahw, QLC_83XX_DRV_OP_MODE, data);
58 qlcnic_83xx_unlock_driver(adapter);
64 qlcnic_83xx_config_vnic_buff_descriptors(struct qlcnic_adapter *adapter)
66 struct qlcnic_hardware_context *ahw = adapter->ahw;
69 adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_VF;
70 adapter->max_rxd = MAX_RCV_DESCRIPTORS_VF;
71 adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G;
72 adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G;
75 adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G;
76 adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G;
77 adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G;
78 adapter->max_rxd = MAX_RCV_DESCRIPTORS_1G;
80 adapter->num_txd = MAX_CMD_DESCRIPTORS;
81 adapter->max_rds_rings = MAX_RDS_RINGS;
88 * @adapter: adapter structure
94 static int qlcnic_83xx_init_mgmt_vnic(struct qlcnic_adapter *adapter)
96 struct qlcnic_hardware_context *ahw = adapter->ahw;
97 struct device *dev = &adapter->pdev->dev;
101 qlcnic_83xx_get_minidump_template(adapter);
103 if (!(adapter->flags & QLCNIC_ADAPTER_INITIALIZED)) {
104 if (qlcnic_init_pci_info(adapter))
107 npar = adapter->npars;
119 if (qlcnic_83xx_set_vnic_opmode(adapter))
122 if (qlcnic_set_default_offload_settings(adapter))
125 if (qlcnic_reset_npar_config(adapter))
129 if (qlcnic_83xx_get_port_info(adapter))
132 qlcnic_83xx_config_vnic_buff_descriptors(adapter);
134 adapter->flags |= QLCNIC_ADAPTER_INITIALIZED;
135 qlcnic_83xx_enable_vnic_mode(adapter, 1);
143 static int qlcnic_83xx_init_privileged_vnic(struct qlcnic_adapter *adapter)
147 qlcnic_83xx_get_minidump_template(adapter);
148 if (qlcnic_83xx_get_port_info(adapter))
151 qlcnic_83xx_config_vnic_buff_descriptors(adapter);
152 adapter->ahw->msix_supported = !!qlcnic_use_msi_x;
153 adapter->flags |= QLCNIC_ADAPTER_INITIALIZED;
155 dev_info(&adapter->pdev->dev,
157 adapter->ahw->fw_hal_version);
161 static int qlcnic_83xx_init_non_privileged_vnic(struct qlcnic_adapter *adapter)
165 qlcnic_83xx_get_fw_version(adapter);
166 if (qlcnic_set_eswitch_port_config(adapter))
169 if (qlcnic_83xx_get_port_info(adapter))
172 qlcnic_83xx_config_vnic_buff_descriptors(adapter);
173 adapter->ahw->msix_supported = !!qlcnic_use_msi_x;
174 adapter->flags |= QLCNIC_ADAPTER_INITIALIZED;
176 dev_info(&adapter->pdev->dev, "HAL Version: %d, Virtual function\n",
177 adapter->ahw->fw_hal_version);
185 * @adapter: adapter structure
191 int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter)
194 struct qlcnic_hardware_context *ahw = adapter->ahw;
195 struct qlcnic_nic_template *nic_ops = adapter->nic_ops;
197 qlcnic_get_func_no(adapter);
198 op_mode = QLCRDX(adapter->ahw, QLC_83XX_DRV_OP_MODE);
222 dev_err(&adapter->pdev->dev, "Invalid Virtual NIC opmode\n");
227 adapter->flags |= QLCNIC_ESWITCH_ENABLED;
228 if (adapter->drv_mac_learn)
229 adapter->rx_mac_learn = true;
231 adapter->flags &= ~QLCNIC_ESWITCH_ENABLED;
232 adapter->rx_mac_learn = false;
241 int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *adapter)
243 struct qlcnic_hardware_context *ahw = adapter->ahw;
255 dev_err(&adapter->pdev->dev,
263 int qlcnic_83xx_set_port_eswitch_status(struct qlcnic_adapter *adapter,
271 err = qlcnic_get_nic_info(adapter, &nic_info, func);
281 adapter->eswitch[*port_id].flags |= QLCNIC_SWITCH_ENABLE;