Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
netxen_nic_hw.c File Reference
#include <linux/slab.h>
#include "netxen_nic.h"
#include "netxen_nic_hw.h"
#include <net/ip.h>

Go to the source code of this file.

Macros

#define MASK(n)   ((1ULL<<(n))-1)
 
#define MN_WIN(addr)   (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))
 
#define OCM_WIN(addr)   (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))
 
#define MS_WIN(addr)   (addr & 0x0ffc0000)
 
#define GET_MEM_OFFS_2M(addr)   (addr & MASK(18))
 
#define CRB_BLK(off)   ((off >> 20) & 0x3f)
 
#define CRB_SUBBLK(off)   ((off >> 16) & 0xf)
 
#define CRB_WINDOW_2M   (0x130060)
 
#define CRB_HI(off)   ((crb_hub_agt[CRB_BLK(off)] << 20) | ((off) & 0xf0000))
 
#define CRB_INDIRECT_2M   (0x1e0000UL)
 
#define PCI_OFFSET_FIRST_RANGE(adapter, off)   ((adapter)->ahw.pci_base0 + (off))
 
#define PCI_OFFSET_SECOND_RANGE(adapter, off)   ((adapter)->ahw.pci_base1 + (off) - SECOND_PAGE_GROUP_START)
 
#define PCI_OFFSET_THIRD_RANGE(adapter, off)   ((adapter)->ahw.pci_base2 + (off) - THIRD_PAGE_GROUP_START)
 
#define NETXEN_WINDOW_ONE   0x2000000 /*CRB Window: bit 25 of CRB address */
 
#define NETXEN_PCIE_SEM_TIMEOUT   10000
 
#define NETXEN_UNICAST_ADDR(port, index)   (NETXEN_UNICAST_ADDR_BASE+(port*32)+(index*8))
 
#define NETXEN_MCAST_ADDR(port, index)   (NETXEN_MULTICAST_ADDR_BASE+(port*0x80)+(index*8))
 
#define MAC_HI(addr)   ((addr[2] << 16) | (addr[1] << 8) | (addr[0]))
 
#define MAC_LO(addr)   ((addr[5] << 16) | (addr[4] << 8) | (addr[3]))
 
#define NETXEN_CONFIG_INTR_COALESCE   3
 
#define RSS_HASHTYPE_IP_TCP   0x3
 
#define MTU_FUDGE_FACTOR   100
 
#define MAX_CTL_CHECK   1000
 

Functions

int netxen_pcie_sem_lock (struct netxen_adapter *adapter, int sem, u32 id_reg)
 
void netxen_pcie_sem_unlock (struct netxen_adapter *adapter, int sem)
 
void netxen_p3_free_mac_list (struct netxen_adapter *adapter)
 
int netxen_config_intr_coalesce (struct netxen_adapter *adapter)
 
int netxen_config_hw_lro (struct netxen_adapter *adapter, int enable)
 
int netxen_config_bridged_mode (struct netxen_adapter *adapter, int enable)
 
int netxen_config_rss (struct netxen_adapter *adapter, int enable)
 
int netxen_config_ipaddr (struct netxen_adapter *adapter, __be32 ip, int cmd)
 
int netxen_linkevent_request (struct netxen_adapter *adapter, int enable)
 
int netxen_send_lro_cleanup (struct netxen_adapter *adapter)
 
int netxen_nic_change_mtu (struct net_device *netdev, int mtu)
 
int netxen_get_flash_mac_addr (struct netxen_adapter *adapter, u64 *mac)
 
int netxen_p3_get_mac_addr (struct netxen_adapter *adapter, u64 *mac)
 
void __iomemnetxen_get_ioaddr (struct netxen_adapter *adapter, u32 offset)
 
void netxen_pci_camqm_read_2M (struct netxen_adapter *adapter, u64 off, u64 *data)
 
void netxen_pci_camqm_write_2M (struct netxen_adapter *adapter, u64 off, u64 data)
 
void netxen_setup_hwops (struct netxen_adapter *adapter)
 
int netxen_nic_get_board_info (struct netxen_adapter *adapter)
 
void netxen_nic_set_link_parameters (struct netxen_adapter *adapter)
 
int netxen_nic_wol_supported (struct netxen_adapter *adapter)
 
void netxen_dump_fw (struct netxen_adapter *adapter)
 

Macro Definition Documentation

#define CRB_BLK (   off)    ((off >> 20) & 0x3f)

Definition at line 39 of file netxen_nic_hw.c.

#define CRB_HI (   off)    ((crb_hub_agt[CRB_BLK(off)] << 20) | ((off) & 0xf0000))

Definition at line 42 of file netxen_nic_hw.c.

#define CRB_INDIRECT_2M   (0x1e0000UL)

Definition at line 43 of file netxen_nic_hw.c.

#define CRB_SUBBLK (   off)    ((off >> 16) & 0xf)

Definition at line 40 of file netxen_nic_hw.c.

#define CRB_WINDOW_2M   (0x130060)

Definition at line 41 of file netxen_nic_hw.c.

#define GET_MEM_OFFS_2M (   addr)    (addr & MASK(18))

Definition at line 37 of file netxen_nic_hw.c.

#define MAC_HI (   addr)    ((addr[2] << 16) | (addr[1] << 8) | (addr[0]))

Definition at line 382 of file netxen_nic_hw.c.

#define MAC_LO (   addr)    ((addr[5] << 16) | (addr[4] << 8) | (addr[3]))

Definition at line 384 of file netxen_nic_hw.c.

#define MASK (   n)    ((1ULL<<(n))-1)

Definition at line 32 of file netxen_nic_hw.c.

#define MAX_CTL_CHECK   1000

Definition at line 1478 of file netxen_nic_hw.c.

#define MN_WIN (   addr)    (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))

Definition at line 33 of file netxen_nic_hw.c.

#define MS_WIN (   addr)    (addr & 0x0ffc0000)

Definition at line 35 of file netxen_nic_hw.c.

#define MTU_FUDGE_FACTOR   100

Definition at line 989 of file netxen_nic_hw.c.

#define NETXEN_CONFIG_INTR_COALESCE   3

Definition at line 773 of file netxen_nic_hw.c.

#define NETXEN_MCAST_ADDR (   port,
  index 
)    (NETXEN_MULTICAST_ADDR_BASE+(port*0x80)+(index*8))

Definition at line 380 of file netxen_nic_hw.c.

#define NETXEN_PCIE_SEM_TIMEOUT   10000

Definition at line 319 of file netxen_nic_hw.c.

#define NETXEN_UNICAST_ADDR (   port,
  index 
)    (NETXEN_UNICAST_ADDR_BASE+(port*32)+(index*8))

Definition at line 378 of file netxen_nic_hw.c.

#define NETXEN_WINDOW_ONE   0x2000000 /*CRB Window: bit 25 of CRB address */

Definition at line 317 of file netxen_nic_hw.c.

#define OCM_WIN (   addr)    (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))

Definition at line 34 of file netxen_nic_hw.c.

#define PCI_OFFSET_FIRST_RANGE (   adapter,
  off 
)    ((adapter)->ahw.pci_base0 + (off))

Definition at line 64 of file netxen_nic_hw.c.

#define PCI_OFFSET_SECOND_RANGE (   adapter,
  off 
)    ((adapter)->ahw.pci_base1 + (off) - SECOND_PAGE_GROUP_START)

Definition at line 66 of file netxen_nic_hw.c.

#define PCI_OFFSET_THIRD_RANGE (   adapter,
  off 
)    ((adapter)->ahw.pci_base2 + (off) - THIRD_PAGE_GROUP_START)

Definition at line 68 of file netxen_nic_hw.c.

#define RSS_HASHTYPE_IP_TCP   0x3

Definition at line 863 of file netxen_nic_hw.c.

Function Documentation

int netxen_config_bridged_mode ( struct netxen_adapter adapter,
int  enable 
)

Definition at line 832 of file netxen_nic_hw.c.

int netxen_config_hw_lro ( struct netxen_adapter adapter,
int  enable 
)

Definition at line 805 of file netxen_nic_hw.c.

int netxen_config_intr_coalesce ( struct netxen_adapter adapter)

Definition at line 778 of file netxen_nic_hw.c.

int netxen_config_ipaddr ( struct netxen_adapter adapter,
__be32  ip,
int  cmd 
)

Definition at line 912 of file netxen_nic_hw.c.

int netxen_config_rss ( struct netxen_adapter adapter,
int  enable 
)

Definition at line 865 of file netxen_nic_hw.c.

void netxen_dump_fw ( struct netxen_adapter adapter)

Definition at line 2547 of file netxen_nic_hw.c.

int netxen_get_flash_mac_addr ( struct netxen_adapter adapter,
u64 mac 
)

Definition at line 1043 of file netxen_nic_hw.c.

void __iomem* netxen_get_ioaddr ( struct netxen_adapter adapter,
u32  offset 
)

Definition at line 1359 of file netxen_nic_hw.c.

int netxen_linkevent_request ( struct netxen_adapter adapter,
int  enable 
)

Definition at line 936 of file netxen_nic_hw.c.

int netxen_nic_change_mtu ( struct net_device netdev,
int  mtu 
)

Definition at line 991 of file netxen_nic_hw.c.

int netxen_nic_get_board_info ( struct netxen_adapter adapter)

Definition at line 1812 of file netxen_nic_hw.c.

void netxen_nic_set_link_parameters ( struct netxen_adapter adapter)

Definition at line 1892 of file netxen_nic_hw.c.

int netxen_nic_wol_supported ( struct netxen_adapter adapter)

Definition at line 1960 of file netxen_nic_hw.c.

void netxen_p3_free_mac_list ( struct netxen_adapter adapter)

Definition at line 752 of file netxen_nic_hw.c.

int netxen_p3_get_mac_addr ( struct netxen_adapter adapter,
u64 mac 
)

Definition at line 1068 of file netxen_nic_hw.c.

void netxen_pci_camqm_read_2M ( struct netxen_adapter adapter,
u64  off,
u64 data 
)

Definition at line 1457 of file netxen_nic_hw.c.

void netxen_pci_camqm_write_2M ( struct netxen_adapter adapter,
u64  off,
u64  data 
)

Definition at line 1468 of file netxen_nic_hw.c.

int netxen_pcie_sem_lock ( struct netxen_adapter adapter,
int  sem,
u32  id_reg 
)

Definition at line 324 of file netxen_nic_hw.c.

void netxen_pcie_sem_unlock ( struct netxen_adapter adapter,
int  sem 
)

Definition at line 344 of file netxen_nic_hw.c.

int netxen_send_lro_cleanup ( struct netxen_adapter adapter)

Definition at line 958 of file netxen_nic_hw.c.

void netxen_setup_hwops ( struct netxen_adapter adapter)

Definition at line 1774 of file netxen_nic_hw.c.