diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index b9123d445c96..673dcf5ea53d 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -706,6 +706,30 @@ int netxen_config_rss(struct netxen_adapter *adapter, int enable) | |||
706 | return rv; | 706 | return rv; |
707 | } | 707 | } |
708 | 708 | ||
709 | int netxen_config_ipaddr(struct netxen_adapter *adapter, u32 ip, int cmd) | ||
710 | { | ||
711 | nx_nic_req_t req; | ||
712 | u64 word; | ||
713 | int rv; | ||
714 | |||
715 | memset(&req, 0, sizeof(nx_nic_req_t)); | ||
716 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); | ||
717 | |||
718 | word = NX_NIC_H2C_OPCODE_CONFIG_IPADDR | ((u64)adapter->portnum << 16); | ||
719 | req.req_hdr = cpu_to_le64(word); | ||
720 | |||
721 | req.words[0] = cpu_to_le64(cmd); | ||
722 | req.words[1] = cpu_to_le64(ip); | ||
723 | |||
724 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | ||
725 | if (rv != 0) { | ||
726 | printk(KERN_ERR "%s: could not notify %s IP 0x%x reuqest\n", | ||
727 | adapter->netdev->name, | ||
728 | (cmd == NX_IP_UP) ? "Add" : "Remove", ip); | ||
729 | } | ||
730 | return rv; | ||
731 | } | ||
732 | |||
709 | int netxen_linkevent_request(struct netxen_adapter *adapter, int enable) | 733 | int netxen_linkevent_request(struct netxen_adapter *adapter, int enable) |
710 | { | 734 | { |
711 | nx_nic_req_t req; | 735 | nx_nic_req_t req; |
@@ -792,18 +816,15 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac) | |||
792 | __le32 *pmac = (__le32 *) mac; | 816 | __le32 *pmac = (__le32 *) mac; |
793 | u32 offset; | 817 | u32 offset; |
794 | 818 | ||
795 | offset = NETXEN_USER_START + | 819 | offset = NX_FW_MAC_ADDR_OFFSET + (adapter->portnum * sizeof(u64)); |
796 | offsetof(struct netxen_new_user_info, mac_addr) + | ||
797 | adapter->portnum * sizeof(u64); | ||
798 | 820 | ||
799 | if (netxen_get_flash_block(adapter, offset, sizeof(u64), pmac) == -1) | 821 | if (netxen_get_flash_block(adapter, offset, sizeof(u64), pmac) == -1) |
800 | return -1; | 822 | return -1; |
801 | 823 | ||
802 | if (*mac == cpu_to_le64(~0ULL)) { | 824 | if (*mac == cpu_to_le64(~0ULL)) { |
803 | 825 | ||
804 | offset = NETXEN_USER_START_OLD + | 826 | offset = NX_OLD_MAC_ADDR_OFFSET + |
805 | offsetof(struct netxen_user_old_info, mac_addr) + | 827 | (adapter->portnum * sizeof(u64)); |
806 | adapter->portnum * sizeof(u64); | ||
807 | 828 | ||
808 | if (netxen_get_flash_block(adapter, | 829 | if (netxen_get_flash_block(adapter, |
809 | offset, sizeof(u64), pmac) == -1) | 830 | offset, sizeof(u64), pmac) == -1) |
@@ -1833,13 +1854,11 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
1833 | int offset, board_type, magic, header_version; | 1854 | int offset, board_type, magic, header_version; |
1834 | struct pci_dev *pdev = adapter->pdev; | 1855 | struct pci_dev *pdev = adapter->pdev; |
1835 | 1856 | ||
1836 | offset = NETXEN_BRDCFG_START + | 1857 | offset = NX_FW_MAGIC_OFFSET; |
1837 | offsetof(struct netxen_board_info, magic); | ||
1838 | if (netxen_rom_fast_read(adapter, offset, &magic)) | 1858 | if (netxen_rom_fast_read(adapter, offset, &magic)) |
1839 | return -EIO; | 1859 | return -EIO; |
1840 | 1860 | ||
1841 | offset = NETXEN_BRDCFG_START + | 1861 | offset = NX_HDR_VERSION_OFFSET; |
1842 | offsetof(struct netxen_board_info, header_version); | ||
1843 | if (netxen_rom_fast_read(adapter, offset, &header_version)) | 1862 | if (netxen_rom_fast_read(adapter, offset, &header_version)) |
1844 | return -EIO; | 1863 | return -EIO; |
1845 | 1864 | ||
@@ -1851,8 +1870,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
1851 | return -EIO; | 1870 | return -EIO; |
1852 | } | 1871 | } |
1853 | 1872 | ||
1854 | offset = NETXEN_BRDCFG_START + | 1873 | offset = NX_BRDTYPE_OFFSET; |
1855 | offsetof(struct netxen_board_info, board_type); | ||
1856 | if (netxen_rom_fast_read(adapter, offset, &board_type)) | 1874 | if (netxen_rom_fast_read(adapter, offset, &board_type)) |
1857 | return -EIO; | 1875 | return -EIO; |
1858 | 1876 | ||
@@ -1998,30 +2016,28 @@ void netxen_nic_get_firmware_info(struct netxen_adapter *adapter) | |||
1998 | u32 fw_major, fw_minor, fw_build; | 2016 | u32 fw_major, fw_minor, fw_build; |
1999 | char brd_name[NETXEN_MAX_SHORT_NAME]; | 2017 | char brd_name[NETXEN_MAX_SHORT_NAME]; |
2000 | char serial_num[32]; | 2018 | char serial_num[32]; |
2001 | int i, addr, val; | 2019 | int i, offset, val; |
2002 | int *ptr32; | 2020 | int *ptr32; |
2003 | struct pci_dev *pdev = adapter->pdev; | 2021 | struct pci_dev *pdev = adapter->pdev; |
2004 | 2022 | ||
2005 | adapter->driver_mismatch = 0; | 2023 | adapter->driver_mismatch = 0; |
2006 | 2024 | ||
2007 | ptr32 = (int *)&serial_num; | 2025 | ptr32 = (int *)&serial_num; |
2008 | addr = NETXEN_USER_START + | 2026 | offset = NX_FW_SERIAL_NUM_OFFSET; |
2009 | offsetof(struct netxen_new_user_info, serial_num); | ||
2010 | for (i = 0; i < 8; i++) { | 2027 | for (i = 0; i < 8; i++) { |
2011 | if (netxen_rom_fast_read(adapter, addr, &val) == -1) { | 2028 | if (netxen_rom_fast_read(adapter, offset, &val) == -1) { |
2012 | dev_err(&pdev->dev, "error reading board info\n"); | 2029 | dev_err(&pdev->dev, "error reading board info\n"); |
2013 | adapter->driver_mismatch = 1; | 2030 | adapter->driver_mismatch = 1; |
2014 | return; | 2031 | return; |
2015 | } | 2032 | } |
2016 | ptr32[i] = cpu_to_le32(val); | 2033 | ptr32[i] = cpu_to_le32(val); |
2017 | addr += sizeof(u32); | 2034 | offset += sizeof(u32); |
2018 | } | 2035 | } |
2019 | 2036 | ||
2020 | fw_major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR); | 2037 | fw_major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR); |
2021 | fw_minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR); | 2038 | fw_minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR); |
2022 | fw_build = NXRD32(adapter, NETXEN_FW_VERSION_SUB); | 2039 | fw_build = NXRD32(adapter, NETXEN_FW_VERSION_SUB); |
2023 | 2040 | ||
2024 | adapter->fw_major = fw_major; | ||
2025 | adapter->fw_version = NETXEN_VERSION_CODE(fw_major, fw_minor, fw_build); | 2041 | adapter->fw_version = NETXEN_VERSION_CODE(fw_major, fw_minor, fw_build); |
2026 | 2042 | ||
2027 | if (adapter->portnum == 0) { | 2043 | if (adapter->portnum == 0) { |
@@ -2047,6 +2063,9 @@ void netxen_nic_get_firmware_info(struct netxen_adapter *adapter) | |||
2047 | dev_info(&pdev->dev, "firmware running in %s mode\n", | 2063 | dev_info(&pdev->dev, "firmware running in %s mode\n", |
2048 | adapter->ahw.cut_through ? "cut-through" : "legacy"); | 2064 | adapter->ahw.cut_through ? "cut-through" : "legacy"); |
2049 | } | 2065 | } |
2066 | |||
2067 | if (adapter->fw_version >= NETXEN_VERSION_CODE(4, 0, 222)) | ||
2068 | adapter->capabilities = NXRD32(adapter, CRB_FW_CAPABILITIES_1); | ||
2050 | } | 2069 | } |
2051 | 2070 | ||
2052 | int | 2071 | int |