Lines Matching refs:esw_cfg

697 		struct qlcnic_esw_func_cfg *esw_cfg)  in qlcnic_set_vlan_config()  argument
699 if (esw_cfg->discard_tagged) in qlcnic_set_vlan_config()
704 if (esw_cfg->vlan_id) in qlcnic_set_vlan_config()
705 adapter->pvid = esw_cfg->vlan_id; in qlcnic_set_vlan_config()
712 struct qlcnic_esw_func_cfg *esw_cfg) in qlcnic_set_eswitch_port_features() argument
717 if (esw_cfg->mac_anti_spoof) in qlcnic_set_eswitch_port_features()
720 if (!esw_cfg->mac_override) in qlcnic_set_eswitch_port_features()
723 if (!esw_cfg->promisc_mode) in qlcnic_set_eswitch_port_features()
726 qlcnic_set_netdev_features(adapter, esw_cfg); in qlcnic_set_eswitch_port_features()
732 struct qlcnic_esw_func_cfg esw_cfg; in qlcnic_set_eswitch_port_config() local
737 esw_cfg.pci_func = adapter->ahw.pci_func; in qlcnic_set_eswitch_port_config()
738 if (qlcnic_get_eswitch_port_config(adapter, &esw_cfg)) in qlcnic_set_eswitch_port_config()
740 qlcnic_set_vlan_config(adapter, &esw_cfg); in qlcnic_set_eswitch_port_config()
741 qlcnic_set_eswitch_port_features(adapter, &esw_cfg); in qlcnic_set_eswitch_port_config()
748 struct qlcnic_esw_func_cfg *esw_cfg) in qlcnic_set_netdev_features() argument
765 if (esw_cfg->offload_flags & BIT_0) { in qlcnic_set_netdev_features()
768 if (!(esw_cfg->offload_flags & BIT_1)) in qlcnic_set_netdev_features()
770 if (!(esw_cfg->offload_flags & BIT_2)) in qlcnic_set_netdev_features()
830 struct qlcnic_esw_func_cfg esw_cfg; in qlcnic_set_default_offload_settings() local
840 memset(&esw_cfg, 0, sizeof(struct qlcnic_esw_func_cfg)); in qlcnic_set_default_offload_settings()
841 esw_cfg.pci_func = i; in qlcnic_set_default_offload_settings()
842 esw_cfg.offload_flags = BIT_0; in qlcnic_set_default_offload_settings()
843 esw_cfg.mac_override = BIT_0; in qlcnic_set_default_offload_settings()
844 esw_cfg.promisc_mode = BIT_0; in qlcnic_set_default_offload_settings()
846 esw_cfg.offload_flags |= (BIT_1 | BIT_2); in qlcnic_set_default_offload_settings()
847 if (qlcnic_config_switch_port(adapter, &esw_cfg)) in qlcnic_set_default_offload_settings()
850 npar->pvid = esw_cfg.vlan_id; in qlcnic_set_default_offload_settings()
851 npar->mac_override = esw_cfg.mac_override; in qlcnic_set_default_offload_settings()
852 npar->mac_anti_spoof = esw_cfg.mac_anti_spoof; in qlcnic_set_default_offload_settings()
853 npar->discard_tagged = esw_cfg.discard_tagged; in qlcnic_set_default_offload_settings()
854 npar->promisc_mode = esw_cfg.promisc_mode; in qlcnic_set_default_offload_settings()
855 npar->offload_flags = esw_cfg.offload_flags; in qlcnic_set_default_offload_settings()
865 struct qlcnic_esw_func_cfg esw_cfg; in qlcnic_reset_eswitch_config() local
866 esw_cfg.op_mode = QLCNIC_PORT_DEFAULTS; in qlcnic_reset_eswitch_config()
867 esw_cfg.pci_func = pci_func; in qlcnic_reset_eswitch_config()
868 esw_cfg.vlan_id = npar->pvid; in qlcnic_reset_eswitch_config()
869 esw_cfg.mac_override = npar->mac_override; in qlcnic_reset_eswitch_config()
870 esw_cfg.discard_tagged = npar->discard_tagged; in qlcnic_reset_eswitch_config()
871 esw_cfg.mac_anti_spoof = npar->mac_anti_spoof; in qlcnic_reset_eswitch_config()
872 esw_cfg.offload_flags = npar->offload_flags; in qlcnic_reset_eswitch_config()
873 esw_cfg.promisc_mode = npar->promisc_mode; in qlcnic_reset_eswitch_config()
874 if (qlcnic_config_switch_port(adapter, &esw_cfg)) in qlcnic_reset_eswitch_config()
877 esw_cfg.op_mode = QLCNIC_ADD_VLAN; in qlcnic_reset_eswitch_config()
878 if (qlcnic_config_switch_port(adapter, &esw_cfg)) in qlcnic_reset_eswitch_config()
3512 struct qlcnic_esw_func_cfg *esw_cfg, int count) in validate_esw_config() argument
3521 pci_func = esw_cfg[i].pci_func; in validate_esw_config()
3529 switch (esw_cfg[i].op_mode) { in validate_esw_config()
3533 if (esw_cfg[i].mac_anti_spoof != 0) in validate_esw_config()
3535 if (esw_cfg[i].mac_override != 1) in validate_esw_config()
3537 if (esw_cfg[i].promisc_mode != 1) in validate_esw_config()
3542 if (!IS_VALID_VLAN(esw_cfg[i].vlan_id)) in validate_esw_config()
3544 if (!esw_cfg[i].op_type) in validate_esw_config()
3548 if (!esw_cfg[i].op_type) in validate_esw_config()
3564 struct qlcnic_esw_func_cfg *esw_cfg; in qlcnic_sysfs_write_esw_config() local
3574 esw_cfg = (struct qlcnic_esw_func_cfg *) buf; in qlcnic_sysfs_write_esw_config()
3575 ret = validate_esw_config(adapter, esw_cfg, count); in qlcnic_sysfs_write_esw_config()
3581 if (qlcnic_config_switch_port(adapter, &esw_cfg[i])) in qlcnic_sysfs_write_esw_config()
3584 if (adapter->ahw.pci_func != esw_cfg[i].pci_func) in qlcnic_sysfs_write_esw_config()
3587 op_mode = esw_cfg[i].op_mode; in qlcnic_sysfs_write_esw_config()
3588 qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]); in qlcnic_sysfs_write_esw_config()
3589 esw_cfg[i].op_mode = op_mode; in qlcnic_sysfs_write_esw_config()
3590 esw_cfg[i].pci_func = adapter->ahw.pci_func; in qlcnic_sysfs_write_esw_config()
3592 switch (esw_cfg[i].op_mode) { in qlcnic_sysfs_write_esw_config()
3594 qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]); in qlcnic_sysfs_write_esw_config()
3597 qlcnic_set_vlan_config(adapter, &esw_cfg[i]); in qlcnic_sysfs_write_esw_config()
3600 esw_cfg[i].vlan_id = 0; in qlcnic_sysfs_write_esw_config()
3601 qlcnic_set_vlan_config(adapter, &esw_cfg[i]); in qlcnic_sysfs_write_esw_config()
3610 pci_func = esw_cfg[i].pci_func; in qlcnic_sysfs_write_esw_config()
3612 switch (esw_cfg[i].op_mode) { in qlcnic_sysfs_write_esw_config()
3614 npar->promisc_mode = esw_cfg[i].promisc_mode; in qlcnic_sysfs_write_esw_config()
3615 npar->mac_override = esw_cfg[i].mac_override; in qlcnic_sysfs_write_esw_config()
3616 npar->offload_flags = esw_cfg[i].offload_flags; in qlcnic_sysfs_write_esw_config()
3617 npar->mac_anti_spoof = esw_cfg[i].mac_anti_spoof; in qlcnic_sysfs_write_esw_config()
3618 npar->discard_tagged = esw_cfg[i].discard_tagged; in qlcnic_sysfs_write_esw_config()
3621 npar->pvid = esw_cfg[i].vlan_id; in qlcnic_sysfs_write_esw_config()
3638 struct qlcnic_esw_func_cfg esw_cfg[QLCNIC_MAX_PCI_FUNC]; in qlcnic_sysfs_read_esw_config() local
3641 if (size != sizeof(esw_cfg)) in qlcnic_sysfs_read_esw_config()
3647 esw_cfg[i].pci_func = i; in qlcnic_sysfs_read_esw_config()
3648 if (qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i])) in qlcnic_sysfs_read_esw_config()
3651 memcpy(buf, &esw_cfg, size); in qlcnic_sysfs_read_esw_config()