Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267633
b: refs/heads/master
c: bf04415
h: refs/heads/master
i:
  267631: 6ad25b2
v: v3
  • Loading branch information
Mark Einon authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 680df4f commit 194d6a0
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 216 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: 567486ac7623e55e81c11ccf5d95c68c617d4e71
refs/heads/master: bf04415e63e2c733fa00756c099dacc66dd69b6c
77 changes: 39 additions & 38 deletions trunk/drivers/staging/et131x/et1310_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ void et1310_config_mac_regs1(struct et131x_adapter *etdev)
* being truncated. Allow the MAC to pass 4 more than our max packet
* size. This is 4 for the Ethernet CRC.
*
* Packets larger than (RegistryJumboPacket) that do not contain a
* Packets larger than (registry_jumbo_packet) that do not contain a
* VLAN ID will be dropped by the Rx function.
*/
writel(etdev->RegistryJumboPacket + 4, &macregs->max_fm_len);
writel(etdev->registry_jumbo_packet + 4, &macregs->max_fm_len);

/* clear out MAC config reset */
writel(0, &macregs->cfg1);
Expand Down Expand Up @@ -294,7 +294,7 @@ void et1310_config_rxmac_regs(struct et131x_adapter *etdev)
writel(0, &rxmac->pf_ctrl);

/* Let's initialize the Unicast Packet filtering address */
if (etdev->PacketFilter & ET131X_PACKET_TYPE_DIRECTED) {
if (etdev->packet_filter & ET131X_PACKET_TYPE_DIRECTED) {
et1310_setup_device_for_unicast(etdev);
pf_ctrl |= 4; /* Unicast filter */
} else {
Expand All @@ -304,7 +304,7 @@ void et1310_config_rxmac_regs(struct et131x_adapter *etdev)
}

/* Let's initialize the Multicast hash */
if (!(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
if (!(etdev->packet_filter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
pf_ctrl |= 2; /* Multicast filter */
et1310_setup_device_for_multicast(etdev);
}
Expand All @@ -313,7 +313,7 @@ void et1310_config_rxmac_regs(struct et131x_adapter *etdev)
pf_ctrl |= (NIC_MIN_PACKET_SIZE + 4) << 16;
pf_ctrl |= 8; /* Fragment filter */

if (etdev->RegistryJumboPacket > 8192)
if (etdev->registry_jumbo_packet > 8192)
/* In order to transmit jumbo packets greater than 8k, the
* FIFO between RxMAC and RxDMA needs to be reduced in size
* to (16k - Jumbo packet size). In order to implement this,
Expand Down Expand Up @@ -489,22 +489,22 @@ void et1310_update_macstat_host_counters(struct et131x_adapter *etdev)
struct macstat_regs __iomem *macstat =
&etdev->regs->macstat;

stats->collisions += readl(&macstat->tx_total_collisions);
stats->first_collision += readl(&macstat->tx_single_collisions);
stats->tx_deferred += readl(&macstat->tx_deferred);
stats->excessive_collisions += readl(&macstat->tx_multiple_collisions);
stats->late_collisions += readl(&macstat->tx_late_collisions);
stats->tx_uflo += readl(&macstat->tx_undersize_frames);
stats->max_pkt_error += readl(&macstat->tx_oversize_frames);

stats->alignment_err += readl(&macstat->rx_align_errs);
stats->crc_err += readl(&macstat->rx_code_errs);
stats->norcvbuf += readl(&macstat->rx_drops);
stats->rx_ov_flow += readl(&macstat->rx_oversize_packets);
stats->code_violations += readl(&macstat->rx_fcs_errs);
stats->length_err += readl(&macstat->rx_frame_len_errs);

stats->other_errors += readl(&macstat->rx_fragment_packets);
stats->tx_collisions += readl(&macstat->tx_total_collisions);
stats->tx_first_collisions += readl(&macstat->tx_single_collisions);
stats->tx_deferred += readl(&macstat->tx_deferred);
stats->tx_excessive_collisions +=
readl(&macstat->tx_multiple_collisions);
stats->tx_late_collisions += readl(&macstat->tx_late_collisions);
stats->tx_underflows += readl(&macstat->tx_undersize_frames);
stats->tx_max_pkt_errs += readl(&macstat->tx_oversize_frames);

stats->rx_align_errs += readl(&macstat->rx_align_errs);
stats->rx_crc_errs += readl(&macstat->rx_code_errs);
stats->rcvd_pkts_dropped += readl(&macstat->rx_drops);
stats->rx_overflows += readl(&macstat->rx_oversize_packets);
stats->rx_code_violations += readl(&macstat->rx_fcs_errs);
stats->rx_length_errs += readl(&macstat->rx_frame_len_errs);
stats->rx_other_errs += readl(&macstat->rx_fragment_packets);
}

/**
Expand Down Expand Up @@ -536,33 +536,33 @@ void et1310_handle_macstat_interrupt(struct et131x_adapter *etdev)
* block indicates that one of the counters has wrapped.
*/
if (carry_reg1 & (1 << 14))
etdev->stats.code_violations += COUNTER_WRAP_16_BIT;
etdev->stats.rx_code_violations += COUNTER_WRAP_16_BIT;
if (carry_reg1 & (1 << 8))
etdev->stats.alignment_err += COUNTER_WRAP_12_BIT;
etdev->stats.rx_align_errs += COUNTER_WRAP_12_BIT;
if (carry_reg1 & (1 << 7))
etdev->stats.length_err += COUNTER_WRAP_16_BIT;
etdev->stats.rx_length_errs += COUNTER_WRAP_16_BIT;
if (carry_reg1 & (1 << 2))
etdev->stats.other_errors += COUNTER_WRAP_16_BIT;
etdev->stats.rx_other_errs += COUNTER_WRAP_16_BIT;
if (carry_reg1 & (1 << 6))
etdev->stats.crc_err += COUNTER_WRAP_16_BIT;
etdev->stats.rx_crc_errs += COUNTER_WRAP_16_BIT;
if (carry_reg1 & (1 << 3))
etdev->stats.rx_ov_flow += COUNTER_WRAP_16_BIT;
etdev->stats.rx_overflows += COUNTER_WRAP_16_BIT;
if (carry_reg1 & (1 << 0))
etdev->stats.norcvbuf += COUNTER_WRAP_16_BIT;
etdev->stats.rcvd_pkts_dropped += COUNTER_WRAP_16_BIT;
if (carry_reg2 & (1 << 16))
etdev->stats.max_pkt_error += COUNTER_WRAP_12_BIT;
etdev->stats.tx_max_pkt_errs += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 15))
etdev->stats.tx_uflo += COUNTER_WRAP_12_BIT;
etdev->stats.tx_underflows += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 6))
etdev->stats.first_collision += COUNTER_WRAP_12_BIT;
etdev->stats.tx_first_collisions += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 8))
etdev->stats.tx_deferred += COUNTER_WRAP_12_BIT;
etdev->stats.tx_deferred += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 5))
etdev->stats.excessive_collisions += COUNTER_WRAP_12_BIT;
etdev->stats.tx_excessive_collisions += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 4))
etdev->stats.late_collisions += COUNTER_WRAP_12_BIT;
etdev->stats.tx_late_collisions += COUNTER_WRAP_12_BIT;
if (carry_reg2 & (1 << 2))
etdev->stats.collisions += COUNTER_WRAP_12_BIT;
etdev->stats.tx_collisions += COUNTER_WRAP_12_BIT;
}

void et1310_setup_device_for_multicast(struct et131x_adapter *etdev)
Expand All @@ -581,10 +581,11 @@ void et1310_setup_device_for_multicast(struct et131x_adapter *etdev)
* specified) then we should pass NO multi-cast addresses to the
* driver.
*/
if (etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) {
if (etdev->packet_filter & ET131X_PACKET_TYPE_MULTICAST) {
/* Loop through our multicast array and set up the device */
for (nIndex = 0; nIndex < etdev->MCAddressCount; nIndex++) {
result = ether_crc(6, etdev->MCList[nIndex]);
for (nIndex = 0; nIndex < etdev->multicast_addr_count;
nIndex++) {
result = ether_crc(6, etdev->multicast_list[nIndex]);

result = (result & 0x3F800000) >> 23;

Expand Down
36 changes: 18 additions & 18 deletions trunk/drivers/staging/et131x/et1310_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
}

/* Determine if we need to go into a force mode and set it */
if (etdev->AiForceSpeed == 0 && etdev->AiForceDpx == 0) {
if (etdev->ai_force_speed == 0 && etdev->ai_force_duplex == 0) {
if (etdev->wanted_flow == FLOW_TXONLY ||
etdev->wanted_flow == FLOW_BOTH)
et1310_phy_access_mii_bit(etdev,
Expand All @@ -623,7 +623,7 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
et1310_phy_auto_neg(etdev, false);

/* Set to the correct force mode. */
if (etdev->AiForceDpx != 1) {
if (etdev->ai_force_duplex != 1) {
if (etdev->wanted_flow == FLOW_TXONLY ||
etdev->wanted_flow == FLOW_BOTH)
et1310_phy_access_mii_bit(etdev,
Expand All @@ -645,16 +645,16 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
4, 11, NULL);
}
et1310_phy_power_down(etdev, 1);
switch (etdev->AiForceSpeed) {
switch (etdev->ai_force_speed) {
case 10:
/* First we need to turn off all other advertisement */
et1310_phy_advertise_1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
et1310_phy_advertise_100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
if (etdev->AiForceDpx == 1) {
if (etdev->ai_force_duplex == 1) {
/* Set our advertise values accordingly */
et1310_phy_advertise_10BaseT(etdev,
TRUEPHY_ADV_DUPLEX_HALF);
} else if (etdev->AiForceDpx == 2) {
} else if (etdev->ai_force_duplex == 2) {
/* Set our advertise values accordingly */
et1310_phy_advertise_10BaseT(etdev,
TRUEPHY_ADV_DUPLEX_FULL);
Expand All @@ -674,13 +674,13 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
/* first we need to turn off all other advertisement */
et1310_phy_advertise_1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
et1310_phy_advertise_10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
if (etdev->AiForceDpx == 1) {
if (etdev->ai_force_duplex == 1) {
/* Set our advertise values accordingly */
et1310_phy_advertise_100BaseT(etdev,
TRUEPHY_ADV_DUPLEX_HALF);
/* Set speed */
et1310_phy_speed_select(etdev, TRUEPHY_SPEED_100MBPS);
} else if (etdev->AiForceDpx == 2) {
} else if (etdev->ai_force_duplex == 2) {
/* Set our advertise values accordingly */
et1310_phy_advertise_100BaseT(etdev,
TRUEPHY_ADV_DUPLEX_FULL);
Expand Down Expand Up @@ -741,11 +741,11 @@ void et131x_mii_check(struct et131x_adapter *etdev,
/* Update our state variables and indicate the
* connected state
*/
spin_lock_irqsave(&etdev->Lock, flags);
spin_lock_irqsave(&etdev->lock, flags);

etdev->MediaState = NETIF_STATUS_MEDIA_CONNECT;
etdev->media_state = NETIF_STATUS_MEDIA_CONNECT;

spin_unlock_irqrestore(&etdev->Lock, flags);
spin_unlock_irqrestore(&etdev->lock, flags);

netif_carrier_on(etdev->netdev);
} else {
Expand Down Expand Up @@ -774,11 +774,11 @@ void et131x_mii_check(struct et131x_adapter *etdev,
* Timer expires, we can report disconnected (handled
* in the LinkDetectionDPC).
*/
if ((etdev->MediaState == NETIF_STATUS_MEDIA_DISCONNECT)) {
spin_lock_irqsave(&etdev->Lock, flags);
etdev->MediaState =
if (etdev->media_state == NETIF_STATUS_MEDIA_DISCONNECT) {
spin_lock_irqsave(&etdev->lock, flags);
etdev->media_state =
NETIF_STATUS_MEDIA_DISCONNECT;
spin_unlock_irqrestore(&etdev->Lock,
spin_unlock_irqrestore(&etdev->lock,
flags);

netif_carrier_off(etdev->netdev);
Expand Down Expand Up @@ -810,15 +810,15 @@ void et131x_mii_check(struct et131x_adapter *etdev,
/* Setup the PHY into coma mode until the cable is
* plugged back in
*/
if (etdev->RegistryPhyComa == 1)
if (etdev->registry_phy_coma == 1)
et1310_enable_phy_coma(etdev);
}
}

if ((bmsr_ints & MI_BMSR_AUTO_NEG_COMPLETE) ||
(etdev->AiForceDpx == 3 && (bmsr_ints & MI_BMSR_LINK_STATUS))) {
(etdev->ai_force_duplex == 3 && (bmsr_ints & MI_BMSR_LINK_STATUS))) {
if ((bmsr & MI_BMSR_AUTO_NEG_COMPLETE) ||
etdev->AiForceDpx == 3) {
etdev->ai_force_duplex == 3) {
et1310_phy_link_status(etdev,
&link_status, &autoneg_status,
&speed, &duplex, &mdi_mdix,
Expand Down Expand Up @@ -849,7 +849,7 @@ void et131x_mii_check(struct et131x_adapter *etdev,
et1310_config_flow_control(etdev);

if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS &&
etdev->RegistryJumboPacket > 2048)
etdev->registry_jumbo_packet > 2048)
et1310_phy_and_or_reg(etdev, 0x16, 0xcfff,
0x2000);

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/et131x/et1310_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ void et1310_enable_phy_coma(struct et131x_adapter *etdev)
/* Save the GbE PHY speed and duplex modes. Need to restore this
* when cable is plugged back in
*/
etdev->pdown_speed = etdev->AiForceSpeed;
etdev->pdown_duplex = etdev->AiForceDpx;
etdev->pdown_speed = etdev->ai_force_speed;
etdev->pdown_duplex = etdev->ai_force_duplex;

/* Stop sending packets. */
spin_lock_irqsave(&etdev->send_hw_lock, flags);
Expand Down Expand Up @@ -153,8 +153,8 @@ void et1310_disable_phy_coma(struct et131x_adapter *etdev)
/* Restore the GbE PHY speed and duplex modes;
* Reset JAGCore; re-configure and initialize JAGCore and gigE PHY
*/
etdev->AiForceSpeed = etdev->pdown_speed;
etdev->AiForceDpx = etdev->pdown_duplex;
etdev->ai_force_speed = etdev->pdown_speed;
etdev->ai_force_duplex = etdev->pdown_duplex;

/* Re-initialize the send structures */
et131x_init_send(etdev);
Expand Down
Loading

0 comments on commit 194d6a0

Please sign in to comment.