Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214913
b: refs/heads/master
c: debf279
h: refs/heads/master
i:
  214911: 7c3e53c
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Oct 5, 2010
1 parent 6f27ca4 commit b70fa6b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 177 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: ee624599d32bc698212d3c04faf908dc01a40457
refs/heads/master: debf279a81c93d6942a50ec0fd3ba1f158b109fb
7 changes: 0 additions & 7 deletions trunk/drivers/net/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1323,19 +1323,12 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
void qlcnic_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring);

/* Management functions */
int qlcnic_set_mac_address(struct qlcnic_adapter *, u8*);
int qlcnic_get_mac_address(struct qlcnic_adapter *, u8*);
int qlcnic_get_nic_info(struct qlcnic_adapter *, struct qlcnic_info *, u8);
int qlcnic_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *);
int qlcnic_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info*);
int qlcnic_reset_partition(struct qlcnic_adapter *, u8);

/* eSwitch management functions */
int qlcnic_get_eswitch_capabilities(struct qlcnic_adapter *, u8,
struct qlcnic_eswitch *);
int qlcnic_get_eswitch_status(struct qlcnic_adapter *, u8,
struct qlcnic_eswitch *);
int qlcnic_toggle_eswitch(struct qlcnic_adapter *, u8, u8);
int qlcnic_config_switch_port(struct qlcnic_adapter *,
struct qlcnic_esw_func_cfg *);
int qlcnic_get_eswitch_port_config(struct qlcnic_adapter *,
Expand Down
169 changes: 0 additions & 169 deletions trunk/drivers/net/qlcnic/qlcnic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,32 +556,6 @@ void qlcnic_free_hw_resources(struct qlcnic_adapter *adapter)
}
}

/* Set MAC address of a NIC partition */
int qlcnic_set_mac_address(struct qlcnic_adapter *adapter, u8* mac)
{
int err = 0;
u32 arg1, arg2, arg3;

arg1 = adapter->ahw.pci_func | BIT_9;
arg2 = mac[0] | (mac[1] << 8) | (mac[2] << 16) | (mac[3] << 24);
arg3 = mac[4] | (mac[5] << 16);

err = qlcnic_issue_cmd(adapter,
adapter->ahw.pci_func,
adapter->fw_hal_version,
arg1,
arg2,
arg3,
QLCNIC_CDRP_CMD_MAC_ADDRESS);

if (err != QLCNIC_RCODE_SUCCESS) {
dev_err(&adapter->pdev->dev,
"Failed to set mac address%d\n", err);
err = -EIO;
}

return err;
}

/* Get MAC address of a NIC partition */
int qlcnic_get_mac_address(struct qlcnic_adapter *adapter, u8 *mac)
Expand Down Expand Up @@ -764,149 +738,6 @@ int qlcnic_get_pci_info(struct qlcnic_adapter *adapter,
return err;
}

/* Reset a NIC partition */

int qlcnic_reset_partition(struct qlcnic_adapter *adapter, u8 func_no)
{
int err = -EIO;

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

err = qlcnic_issue_cmd(adapter,
adapter->ahw.pci_func,
adapter->fw_hal_version,
func_no,
0,
0,
QLCNIC_CDRP_CMD_RESET_NPAR);

if (err != QLCNIC_RCODE_SUCCESS) {
dev_err(&adapter->pdev->dev,
"Failed to issue reset partition%d\n", err);
err = -EIO;
}

return err;
}

/* Get eSwitch Capabilities */
int qlcnic_get_eswitch_capabilities(struct qlcnic_adapter *adapter, u8 port,
struct qlcnic_eswitch *eswitch)
{
int err = -EIO;
u32 arg1, arg2;

if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC)
return err;

err = qlcnic_issue_cmd(adapter,
adapter->ahw.pci_func,
adapter->fw_hal_version,
port,
0,
0,
QLCNIC_CDRP_CMD_GET_ESWITCH_CAPABILITY);

if (err == QLCNIC_RCODE_SUCCESS) {
arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET);

eswitch->port = arg1 & 0xf;
eswitch->max_ucast_filters = LSW(arg2);
eswitch->max_active_vlans = MSW(arg2) & 0xfff;
if (arg1 & BIT_6)
eswitch->flags |= QLCNIC_SWITCH_VLAN_FILTERING;
if (arg1 & BIT_7)
eswitch->flags |= QLCNIC_SWITCH_PROMISC_MODE;
if (arg1 & BIT_8)
eswitch->flags |= QLCNIC_SWITCH_PORT_MIRRORING;
} else {
dev_err(&adapter->pdev->dev,
"Failed to get eswitch capabilities%d\n", err);
}

return err;
}

/* Get current status of eswitch */
int qlcnic_get_eswitch_status(struct qlcnic_adapter *adapter, u8 port,
struct qlcnic_eswitch *eswitch)
{
int err = -EIO;
u32 arg1, arg2;

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

err = qlcnic_issue_cmd(adapter,
adapter->ahw.pci_func,
adapter->fw_hal_version,
port,
0,
0,
QLCNIC_CDRP_CMD_GET_ESWITCH_STATUS);

if (err == QLCNIC_RCODE_SUCCESS) {
arg1 = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
arg2 = QLCRD32(adapter, QLCNIC_ARG2_CRB_OFFSET);

eswitch->port = arg1 & 0xf;
eswitch->active_vports = LSB(arg2);
eswitch->active_ucast_filters = MSB(arg2);
eswitch->active_vlans = LSB(MSW(arg2));
if (arg1 & BIT_6)
eswitch->flags |= QLCNIC_SWITCH_VLAN_FILTERING;
if (arg1 & BIT_8)
eswitch->flags |= QLCNIC_SWITCH_PORT_MIRRORING;

} else {
dev_err(&adapter->pdev->dev,
"Failed to get eswitch status%d\n", err);
}

return err;
}

/* Enable/Disable eSwitch */
int qlcnic_toggle_eswitch(struct qlcnic_adapter *adapter, u8 id, u8 enable)
{
int err = -EIO;
u32 arg1, arg2;
struct qlcnic_eswitch *eswitch;

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

eswitch = &adapter->eswitch[id];
if (!eswitch)
return err;

arg1 = eswitch->port | (enable ? BIT_4 : 0);
arg2 = eswitch->active_vports | (eswitch->max_ucast_filters << 8) |
(eswitch->max_active_vlans << 16);
err = qlcnic_issue_cmd(adapter,
adapter->ahw.pci_func,
adapter->fw_hal_version,
arg1,
arg2,
0,
QLCNIC_CDRP_CMD_TOGGLE_ESWITCH);

if (err != QLCNIC_RCODE_SUCCESS) {
dev_err(&adapter->pdev->dev,
"Failed to enable eswitch%d\n", eswitch->port);
eswitch->flags &= ~QLCNIC_SWITCH_ENABLE;
err = -EIO;
} else {
eswitch->flags |= QLCNIC_SWITCH_ENABLE;
dev_info(&adapter->pdev->dev,
"Enabled eSwitch for port %d\n", eswitch->port);
}

return err;
}

/* Configure eSwitch for port mirroring */
int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id,
u8 enable_mirroring, u8 pci_func)
Expand Down

0 comments on commit b70fa6b

Please sign in to comment.