mode = ipg_r32(ASIC_CTRL);
mode &= ~(IPG_AC_LED_MODE_BIT_1 | IPG_AC_LED_MODE | IPG_AC_LED_SPEED);
- if ((sp->LED_Mode & 0x03) > 1)
+ if ((sp->led_mode & 0x03) > 1)
mode |= IPG_AC_LED_MODE_BIT_1; /* Write Asic Control Bit 29 */
- if ((sp->LED_Mode & 0x01) == 1)
+ if ((sp->led_mode & 0x01) == 1)
mode |= IPG_AC_LED_MODE; /* Write Asic Control Bit 14 */
- if ((sp->LED_Mode & 0x08) == 8)
+ if ((sp->led_mode & 0x08) == 8)
mode |= IPG_AC_LED_SPEED; /* Write Asic Control Bit 27 */
ipg_w32(mode, ASIC_CTRL);
physet = ipg_r8(PHY_SET);
physet &= ~(IPG_PS_MEM_LENB9B | IPG_PS_MEM_LEN9 | IPG_PS_NON_COMPDET);
- physet |= ((sp->LED_Mode & 0x70) >> 4);
+ physet |= ((sp->led_mode & 0x70) >> 4);
ipg_w8(physet, PHY_SET);
}
skb = netdev_alloc_skb(dev, IPG_RXSUPPORT_SIZE + NET_IP_ALIGN);
if (!skb) {
- sp->RxBuff[entry] = NULL;
+ sp->rx_buff[entry] = NULL;
return -ENOMEM;
}
skb->dev = dev;
/* Save the address of the sk_buff structure. */
- sp->RxBuff[entry] = skb;
+ sp->rx_buff[entry] = skb;
rxfd->frag_info = cpu_to_le64(pci_map_single(sp->pdev, skb->data,
sp->rx_buf_sz, PCI_DMA_FROMDEVICE));
for (i = 0; i < IPG_RFDLIST_LENGTH; i++) {
struct ipg_rx *rxfd = sp->rxd + i;
- if (sp->RxBuff[i]) {
+ if (sp->rx_buff[i]) {
pci_unmap_single(sp->pdev,
le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
- dev_kfree_skb_irq(sp->RxBuff[i]);
- sp->RxBuff[i] = NULL;
+ dev_kfree_skb_irq(sp->rx_buff[i]);
+ sp->rx_buff[i] = NULL;
}
/* Clear out the RFS field. */
txfd->tfc = cpu_to_le64(IPG_TFC_TFDDONE);
- if (sp->TxBuff[i]) {
- dev_kfree_skb_irq(sp->TxBuff[i]);
- sp->TxBuff[i] = NULL;
+ if (sp->tx_buff[i]) {
+ dev_kfree_skb_irq(sp->tx_buff[i]);
+ sp->tx_buff[i] = NULL;
}
txfd->next_desc = cpu_to_le64(sp->txd_map +
ipg_w32((u32) sp->txd_map, TFD_LIST_PTR_0);
ipg_w32(0x00000000, TFD_LIST_PTR_1);
- sp->ResetCurrentTFD = 1;
+ sp->reset_current_tfd = 1;
}
/*
dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH;
for (released = 0; released < pending; released++) {
- struct sk_buff *skb = sp->TxBuff[dirty];
+ struct sk_buff *skb = sp->tx_buff[dirty];
struct ipg_tx *txfd = sp->txd + dirty;
IPG_DEBUG_MSG("TFC = %16.16lx\n", (unsigned long) txfd->tfc);
dev_kfree_skb_irq(skb);
- sp->TxBuff[dirty] = NULL;
+ sp->tx_buff[dirty] = NULL;
}
dirty = (dirty + 1) % IPG_TFDLIST_LENGTH;
}
unsigned int entry = dirty % IPG_RFDLIST_LENGTH;
/* rx_copybreak may poke hole here and there. */
- if (sp->RxBuff[entry])
+ if (sp->rx_buff[entry])
continue;
/* Generate a new receive buffer to replace the
previous receiving and need to continue dumping the current one
*/
enum {
- NormalPacket,
- ErrorPacket
+ NORMAL_PACKET,
+ ERROR_PACKET
};
enum {
- Frame_NoStart_NoEnd = 0,
- Frame_WithStart = 1,
- Frame_WithEnd = 10,
- Frame_WithStart_WithEnd = 11
+ FRAME_NO_START_NO_END = 0,
+ FRAME_WITH_START = 1,
+ FRAME_WITH_END = 10,
+ FRAME_WITH_START_WITH_END = 11
};
inline void ipg_nic_rx_free_skb(struct net_device *dev)
struct ipg_nic_private *sp = netdev_priv(dev);
unsigned int entry = sp->rx_current % IPG_RFDLIST_LENGTH;
- if (sp->RxBuff[entry]) {
+ if (sp->rx_buff[entry]) {
struct ipg_rx *rxfd = sp->rxd + entry;
pci_unmap_single(sp->pdev,
le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
- dev_kfree_skb_irq(sp->RxBuff[entry]);
- sp->RxBuff[entry] = NULL;
+ dev_kfree_skb_irq(sp->rx_buff[entry]);
+ sp->rx_buff[entry] = NULL;
}
}
{
struct ipg_nic_private *sp = netdev_priv(dev);
struct ipg_rx *rxfd = sp->rxd + (sp->rx_current % IPG_RFDLIST_LENGTH);
- int type = Frame_NoStart_NoEnd;
+ int type = FRAME_NO_START_NO_END;
if (le64_to_cpu(rxfd->rfs) & IPG_RFS_FRAMESTART)
- type += Frame_WithStart;
+ type += FRAME_WITH_START;
if (le64_to_cpu(rxfd->rfs) & IPG_RFS_FRAMEEND)
- type += Frame_WithEnd;
+ type += FRAME_WITH_END;
return type;
}
* buffer since it is erroneous and we will
* not pass it to higher layer processes.
*/
- if (sp->RxBuff[entry]) {
+ if (sp->rx_buff[entry]) {
pci_unmap_single(sp->pdev,
le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
- dev_kfree_skb_irq(sp->RxBuff[entry]);
- sp->RxBuff[entry] = NULL;
+ dev_kfree_skb_irq(sp->rx_buff[entry]);
+ sp->rx_buff[entry] = NULL;
}
- return ErrorPacket;
+ return ERROR_PACKET;
}
- return NormalPacket;
+ return NORMAL_PACKET;
}
static void ipg_nic_rx_with_start_and_end(struct net_device *dev,
struct ipg_nic_private *sp,
struct ipg_rx *rxfd, unsigned entry)
{
- struct SJumbo *jumbo = &sp->Jumbo;
+ struct ipg_jumbo *jumbo = &sp->jumbo;
struct sk_buff *skb;
int framelen;
- if (jumbo->FoundStart) {
+ if (jumbo->found_start) {
dev_kfree_skb_irq(jumbo->skb);
- jumbo->FoundStart = 0;
- jumbo->CurrentSize = 0;
+ jumbo->found_start = 0;
+ jumbo->current_size = 0;
jumbo->skb = NULL;
}
// 1: found error, 0 no error
- if (ipg_nic_rx_check_error(dev) != NormalPacket)
+ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET)
return;
- skb = sp->RxBuff[entry];
+ skb = sp->rx_buff[entry];
if (!skb)
return;
skb->ip_summed = CHECKSUM_NONE;
netif_rx(skb);
dev->last_rx = jiffies;
- sp->RxBuff[entry] = NULL;
+ sp->rx_buff[entry] = NULL;
}
static void ipg_nic_rx_with_start(struct net_device *dev,
struct ipg_nic_private *sp,
struct ipg_rx *rxfd, unsigned entry)
{
- struct SJumbo *jumbo = &sp->Jumbo;
+ struct ipg_jumbo *jumbo = &sp->jumbo;
struct pci_dev *pdev = sp->pdev;
struct sk_buff *skb;
// 1: found error, 0 no error
- if (ipg_nic_rx_check_error(dev) != NormalPacket)
+ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET)
return;
// accept this frame and send to upper layer
- skb = sp->RxBuff[entry];
+ skb = sp->rx_buff[entry];
if (!skb)
return;
- if (jumbo->FoundStart)
+ if (jumbo->found_start)
dev_kfree_skb_irq(jumbo->skb);
pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN),
skb_put(skb, IPG_RXFRAG_SIZE);
- jumbo->FoundStart = 1;
- jumbo->CurrentSize = IPG_RXFRAG_SIZE;
+ jumbo->found_start = 1;
+ jumbo->current_size = IPG_RXFRAG_SIZE;
jumbo->skb = skb;
- sp->RxBuff[entry] = NULL;
+ sp->rx_buff[entry] = NULL;
dev->last_rx = jiffies;
}
struct ipg_nic_private *sp,
struct ipg_rx *rxfd, unsigned entry)
{
- struct SJumbo *jumbo = &sp->Jumbo;
+ struct ipg_jumbo *jumbo = &sp->jumbo;
//1: found error, 0 no error
- if (ipg_nic_rx_check_error(dev) == NormalPacket) {
- struct sk_buff *skb = sp->RxBuff[entry];
+ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) {
+ struct sk_buff *skb = sp->rx_buff[entry];
if (!skb)
return;
- if (jumbo->FoundStart) {
+ if (jumbo->found_start) {
int framelen, endframelen;
framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN;
- endframeLen = framelen - jumbo->CurrentSize;
+ endframeLen = framelen - jumbo->current_size;
/*
if (framelen > IPG_RXFRAG_SIZE)
framelen=IPG_RXFRAG_SIZE;
}
dev->last_rx = jiffies;
- jumbo->FoundStart = 0;
- jumbo->CurrentSize = 0;
+ jumbo->found_start = 0;
+ jumbo->current_size = 0;
jumbo->skb = NULL;
ipg_nic_rx_free_skb(dev);
} else {
dev_kfree_skb_irq(jumbo->skb);
- jumbo->FoundStart = 0;
- jumbo->CurrentSize = 0;
+ jumbo->found_start = 0;
+ jumbo->current_size = 0;
jumbo->skb = NULL;
}
}
struct ipg_nic_private *sp,
struct ipg_rx *rxfd, unsigned entry)
{
- struct SJumbo *jumbo = &sp->Jumbo;
+ struct ipg_jumbo *jumbo = &sp->jumbo;
//1: found error, 0 no error
- if (ipg_nic_rx_check_error(dev) == NormalPacket) {
- struct sk_buff *skb = sp->RxBuff[entry];
+ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) {
+ struct sk_buff *skb = sp->rx_buff[entry];
if (skb) {
- if (jumbo->FoundStart) {
- jumbo->CurrentSize += IPG_RXFRAG_SIZE;
- if (jumbo->CurrentSize <= IPG_RXSUPPORT_SIZE) {
+ if (jumbo->found_start) {
+ jumbo->current_size += IPG_RXFRAG_SIZE;
+ if (jumbo->current_size <= IPG_RXSUPPORT_SIZE) {
memcpy(skb_put(jumbo->skb,
IPG_RXFRAG_SIZE),
skb->data, IPG_RXFRAG_SIZE);
}
} else {
dev_kfree_skb_irq(jumbo->skb);
- jumbo->FoundStart = 0;
- jumbo->CurrentSize = 0;
+ jumbo->found_start = 0;
+ jumbo->current_size = 0;
jumbo->skb = NULL;
}
}
break;
switch (ipg_nic_rx_check_frame_type(dev)) {
- case Frame_WithStart_WithEnd:
+ case FRAME_WITH_START_WITH_END:
ipg_nic_rx_with_start_and_end(dev, tp, rxfd, entry);
break;
- case Frame_WithStart:
+ case FRAME_WITH_START:
ipg_nic_rx_with_start(dev, tp, rxfd, entry);
break;
- case Frame_WithEnd:
+ case FRAME_WITH_END:
ipg_nic_rx_with_end(dev, tp, rxfd, entry);
break;
- case Frame_NoStart_NoEnd:
+ case FRAME_NO_START_NO_END:
ipg_nic_rx_no_start_no_end(dev, tp, rxfd, entry);
break;
}
for (i = 0; i < IPG_MAXRFDPROCESS_COUNT; i++, curr++) {
unsigned int entry = curr % IPG_RFDLIST_LENGTH;
- struct sk_buff *skb = sp->RxBuff[entry];
+ struct sk_buff *skb = sp->rx_buff[entry];
unsigned int framelen;
rxfd = sp->rxd + entry;
}
/* Assure RX buffer is not reused by IPG. */
- sp->RxBuff[entry] = NULL;
+ sp->rx_buff[entry] = NULL;
}
/*
* buffer since it is erroneous and we will
* not pass it to higher layer processes.
*/
- if (sp->RxBuff[entry]) {
+ if (sp->rx_buff[entry]) {
pci_unmap_single(sp->pdev,
le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
- dev_kfree_skb_irq(sp->RxBuff[entry]);
+ dev_kfree_skb_irq(sp->rx_buff[entry]);
}
/* Assure RX buffer is not reused by IPG. */
- sp->RxBuff[entry] = NULL;
+ sp->rx_buff[entry] = NULL;
}
sp->rx_current = curr;
unsigned int i;
for (i = 0; i < IPG_RFDLIST_LENGTH; i++) {
- if (sp->RxBuff[i]) {
+ if (sp->rx_buff[i]) {
struct ipg_rx *rxfd = sp->rxd + i;
- dev_kfree_skb_irq(sp->RxBuff[i]);
- sp->RxBuff[i] = NULL;
+ dev_kfree_skb_irq(sp->rx_buff[i]);
+ sp->rx_buff[i] = NULL;
pci_unmap_single(sp->pdev,
le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
unsigned int i;
for (i = 0; i < IPG_TFDLIST_LENGTH; i++) {
- if (sp->TxBuff[i]) {
+ if (sp->tx_buff[i]) {
struct ipg_tx *txfd = sp->txd + i;
pci_unmap_single(sp->pdev,
le64_to_cpu(txfd->frag_info) & ~IPG_TFI_FRAGLEN,
- sp->TxBuff[i]->len, PCI_DMA_TODEVICE);
+ sp->tx_buff[i]->len, PCI_DMA_TODEVICE);
- dev_kfree_skb_irq(sp->TxBuff[i]);
+ dev_kfree_skb_irq(sp->tx_buff[i]);
- sp->TxBuff[i] = NULL;
+ sp->tx_buff[i] = NULL;
}
}
}
#ifdef JUMBO_FRAME
/* initialize JUMBO Frame control variable */
- sp->Jumbo.FoundStart = 0;
- sp->Jumbo.CurrentSize = 0;
- sp->Jumbo.skb = 0;
+ sp->jumbo.found_start = 0;
+ sp->jumbo.current_size = 0;
+ sp->jumbo.skb = 0;
dev->mtu = IPG_TXFRAG_SIZE;
#endif
if (sp->tenmbpsmode)
netif_stop_queue(dev);
- if (sp->ResetCurrentTFD) {
- sp->ResetCurrentTFD = 0;
+ if (sp->reset_current_tfd) {
+ sp->reset_current_tfd = 0;
entry = 0;
}
txfd = sp->txd + entry;
- sp->TxBuff[entry] = skb;
+ sp->tx_buff[entry] = skb;
/* Clear all TFC fields, except TFDDONE. */
txfd->tfc = cpu_to_le64(IPG_TFC_TFDDONE);
/* Read/Write and Reset EEPROM Value */
/* Read LED Mode Configuration from EEPROM */
- sp->LED_Mode = read_eeprom(dev, 6);
+ sp->led_mode = read_eeprom(dev, 6);
/* Reset all functions within the IPG. Do not assert
* RST_OUT as not compatible with some PHYs.