Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117151
b: refs/heads/master
c: c6c25ed
h: refs/heads/master
i:
  117149: 558cc7f
  117147: 1148ea1
  117143: 6b9af25
  117135: d3bf799
  117119: 278bf66
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 22, 2008
1 parent 3537bda commit ad2af7c
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 78 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: b243c4aaf8d470a99101521c9197ed5b38084793
refs/heads/master: c6c25ed0bcd8c5d6caf6091e2714b7ccc87316a6
155 changes: 78 additions & 77 deletions trunk/drivers/staging/sxg/sxg.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ static bool sxg_mac_filter(p_adapter_t adapter,
static struct net_device_stats *sxg_get_stats(p_net_device dev);
#endif

#define XXXTODO 0

#if XXXTODO
static int sxg_mac_set_address(p_net_device dev, void *ptr);
static void sxg_mcast_set_list(p_net_device dev);
#endif

static void sxg_adapter_set_hwaddr(p_adapter_t adapter);

static void sxg_unmap_mmio_space(p_adapter_t adapter);
static void sxg_mcast_set_mask(p_adapter_t adapter);

static int sxg_initialize_adapter(p_adapter_t adapter);
static void sxg_stock_rcv_buffers(p_adapter_t adapter);
Expand All @@ -132,9 +136,6 @@ static int sxg_write_mdio_reg(p_adapter_t adapter,
u32 DevAddr, u32 RegAddr, u32 Value);
static int sxg_read_mdio_reg(p_adapter_t adapter,
u32 DevAddr, u32 RegAddr, u32 *pValue);
static void sxg_mcast_set_list(p_net_device dev);

#define XXXTODO 0

static unsigned int sxg_first_init = 1;
static char *sxg_banner =
Expand Down Expand Up @@ -2667,38 +2668,6 @@ static int sxg_read_mdio_reg(p_adapter_t adapter,
return (STATUS_SUCCESS);
}

/*
* Allocate a mcast_address structure to hold the multicast address.
* Link it in.
*/
static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
{
p_mcast_address_t mcaddr, mlist;
bool equaladdr;

/* Check to see if it already exists */
mlist = adapter->mcastaddrs;
while (mlist) {
ETHER_EQ_ADDR(mlist->address, address, equaladdr);
if (equaladdr) {
return (STATUS_SUCCESS);
}
mlist = mlist->next;
}

/* Doesn't already exist. Allocate a structure to hold it */
mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC);
if (mcaddr == NULL)
return 1;

memcpy(mcaddr->address, address, 6);

mcaddr->next = adapter->mcastaddrs;
adapter->mcastaddrs = mcaddr;

return (STATUS_SUCCESS);
}

/*
* Functions to obtain the CRC corresponding to the destination mac address.
* This is a standard ethernet CRC in that it is a 32-bit, reflected CRC using
Expand All @@ -2710,7 +2679,6 @@ static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
*
*/
static u32 sxg_crc_table[256]; /* Table of CRC's for all possible byte values */
static u32 sxg_crc_init; /* Is table initialized */

/*
* Contruct the CRC32 table
Expand All @@ -2737,6 +2705,8 @@ static void sxg_mcast_init_crc32(void)
}
}

#if XXXTODO
static u32 sxg_crc_init; /* Is table initialized */
/*
* Return the MAC hast as described above.
*/
Expand Down Expand Up @@ -2765,6 +2735,74 @@ static unsigned char sxg_mcast_get_mac_hash(char *macaddr)
return (machash);
}

static void sxg_mcast_set_mask(p_adapter_t adapter)
{
PSXG_UCODE_REGS sxg_regs = adapter->UcodeRegs;

DBG_ERROR("%s ENTER (%s) macopts[%x] mask[%llx]\n", __func__,
adapter->netdev->name, (unsigned int)adapter->MacFilter,
adapter->MulticastMask);

if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) {
/* Turn on all multicast addresses. We have to do this for promiscuous
* mode as well as ALLMCAST mode. It saves the Microcode from having
* to keep state about the MAC configuration.
*/
/* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */
WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH);
WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH);
/* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */

} else {
/* Commit our multicast mast to the SLIC by writing to the multicast
* address mask registers
*/
DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n",
__func__, adapter->netdev->name,
((ulong) (adapter->MulticastMask & 0xFFFFFFFF)),
((ulong)
((adapter->MulticastMask >> 32) & 0xFFFFFFFF)));

WRITE_REG(sxg_regs->McastLow,
(u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH);
WRITE_REG(sxg_regs->McastHigh,
(u32) ((adapter->
MulticastMask >> 32) & 0xFFFFFFFF), FLUSH);
}
}

/*
* Allocate a mcast_address structure to hold the multicast address.
* Link it in.
*/
static int sxg_mcast_add_list(p_adapter_t adapter, char *address)
{
p_mcast_address_t mcaddr, mlist;
bool equaladdr;

/* Check to see if it already exists */
mlist = adapter->mcastaddrs;
while (mlist) {
ETHER_EQ_ADDR(mlist->address, address, equaladdr);
if (equaladdr) {
return (STATUS_SUCCESS);
}
mlist = mlist->next;
}

/* Doesn't already exist. Allocate a structure to hold it */
mcaddr = kmalloc(sizeof(mcast_address_t), GFP_ATOMIC);
if (mcaddr == NULL)
return 1;

memcpy(mcaddr->address, address, 6);

mcaddr->next = adapter->mcastaddrs;
adapter->mcastaddrs = mcaddr;

return (STATUS_SUCCESS);
}

static void sxg_mcast_set_bit(p_adapter_t adapter, char *address)
{
unsigned char crcpoly;
Expand All @@ -2783,7 +2821,6 @@ static void sxg_mcast_set_bit(p_adapter_t adapter, char *address)

static void sxg_mcast_set_list(p_net_device dev)
{
#if XXXTODO
p_adapter_t adapter = (p_adapter_t) netdev_priv(dev);
int status = STATUS_SUCCESS;
int i;
Expand Down Expand Up @@ -2835,45 +2872,9 @@ static void sxg_mcast_set_list(p_net_device dev)
sxg_mcast_set_mask(adapter);
}
}
#endif
return;
}

static void sxg_mcast_set_mask(p_adapter_t adapter)
{
PSXG_UCODE_REGS sxg_regs = adapter->UcodeRegs;

DBG_ERROR("%s ENTER (%s) macopts[%x] mask[%llx]\n", __func__,
adapter->netdev->name, (unsigned int)adapter->MacFilter,
adapter->MulticastMask);

if (adapter->MacFilter & (MAC_ALLMCAST | MAC_PROMISC)) {
/* Turn on all multicast addresses. We have to do this for promiscuous
* mode as well as ALLMCAST mode. It saves the Microcode from having
* to keep state about the MAC configuration.
*/
/* DBG_ERROR("sxg: %s macopts = MAC_ALLMCAST | MAC_PROMISC\n SLUT MODE!!!\n",__func__); */
WRITE_REG(sxg_regs->McastLow, 0xFFFFFFFF, FLUSH);
WRITE_REG(sxg_regs->McastHigh, 0xFFFFFFFF, FLUSH);
/* DBG_ERROR("%s (%s) WRITE to slic_regs slic_mcastlow&high 0xFFFFFFFF\n",__func__, adapter->netdev->name); */

} else {
/* Commit our multicast mast to the SLIC by writing to the multicast
* address mask registers
*/
DBG_ERROR("%s (%s) WRITE mcastlow[%lx] mcasthigh[%lx]\n",
__func__, adapter->netdev->name,
((ulong) (adapter->MulticastMask & 0xFFFFFFFF)),
((ulong)
((adapter->MulticastMask >> 32) & 0xFFFFFFFF)));

WRITE_REG(sxg_regs->McastLow,
(u32) (adapter->MulticastMask & 0xFFFFFFFF), FLUSH);
WRITE_REG(sxg_regs->McastHigh,
(u32) ((adapter->
MulticastMask >> 32) & 0xFFFFFFFF), FLUSH);
}
}
#endif

static void sxg_unmap_mmio_space(p_adapter_t adapter)
{
Expand Down Expand Up @@ -3267,9 +3268,9 @@ static void sxg_adapter_set_hwaddr(p_adapter_t adapter)

}

#if XXXTODO
static int sxg_mac_set_address(p_net_device dev, void *ptr)
{
#if XXXTODO
p_adapter_t adapter = (p_adapter_t) netdev_priv(dev);
struct sockaddr *addr = ptr;

Expand All @@ -3295,9 +3296,9 @@ static int sxg_mac_set_address(p_net_device dev, void *ptr)
adapter->currmacaddr[5]);

sxg_config_set(adapter, TRUE);
#endif
return 0;
}
#endif

/*****************************************************************************/
/************* SXG DRIVER FUNCTIONS (below) ********************************/
Expand Down

0 comments on commit ad2af7c

Please sign in to comment.