Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f327220b authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

parents 31b3c31b ea182d4a
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -28,8 +28,8 @@

#define DRV_MODULE_NAME		"b44"
#define PFX DRV_MODULE_NAME	": "
#define DRV_MODULE_VERSION	"0.96"
#define DRV_MODULE_RELDATE	"Nov 8, 2005"
#define DRV_MODULE_VERSION	"0.97"
#define DRV_MODULE_RELDATE	"Nov 30, 2005"

#define B44_DEF_MSG_ENABLE	  \
	(NETIF_MSG_DRV		| \
@@ -1417,6 +1417,7 @@ static int b44_open(struct net_device *dev)
	add_timer(&bp->timer);

	b44_enable_ints(bp);
	netif_start_queue(dev);
out:
	return err;
}
@@ -1837,12 +1838,15 @@ static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
	struct mii_ioctl_data *data = if_mii(ifr);
	struct b44 *bp = netdev_priv(dev);
	int err;
	int err = -EINVAL;

	if (!netif_running(dev))
		goto out;

	spin_lock_irq(&bp->lock);
	err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
	spin_unlock_irq(&bp->lock);

out:
	return err;
}

@@ -2113,6 +2117,7 @@ static int b44_resume(struct pci_dev *pdev)
	add_timer(&bp->timer);

	b44_enable_ints(bp);
	netif_wake_queue(dev);
	return 0;
}

+1 −13
Original line number Diff line number Diff line
@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
			return 0;
	}
	if(htons(ETH_P_IP) == skb->protocol) {
		const struct iphdr *ip = skb->nh.iph;
		if(IPPROTO_UDP == ip->protocol) {
			struct udphdr *udp = (struct udphdr *)(skb->h.uh);
			if(ntohs(udp->dest) == 67) {
				offset = (uint8_t *)udp + 8 - skb->data;
				length = skb->len - offset;

				return e1000_mng_write_dhcp_info(hw,
						(uint8_t *)udp + 8, length);
			}
		}
	} else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
 	if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
		struct ethhdr *eth = (struct ethhdr *) skb->data;
		if((htons(ETH_P_IP) == eth->h_proto)) {
			const struct iphdr *ip = 
+29 −9
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
 */

#define DRV_NAME        "emac"
#define DRV_VERSION     "3.53"
#define DRV_VERSION     "3.54"
#define DRV_DESC        "PPC 4xx OCP EMAC driver"

MODULE_DESCRIPTION(DRV_DESC);
@@ -158,6 +158,14 @@ static inline void emac_report_timeout_error(struct ocp_enet_private *dev,
#define PHY_POLL_LINK_ON	HZ
#define PHY_POLL_LINK_OFF	(HZ / 5)

/* Graceful stop timeouts in us. 
 * We should allow up to 1 frame time (full-duplex, ignoring collisions) 
 */
#define STOP_TIMEOUT_10		1230	
#define STOP_TIMEOUT_100	124
#define STOP_TIMEOUT_1000	13
#define STOP_TIMEOUT_1000_JUMBO	73

/* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
	"rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
@@ -222,10 +230,12 @@ static void emac_tx_disable(struct ocp_enet_private *dev)

	r = in_be32(&p->mr0);
	if (r & EMAC_MR0_TXE) {
		int n = 300;
		int n = dev->stop_timeout;
		out_be32(&p->mr0, r & ~EMAC_MR0_TXE);
		while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n)
		while (!(in_be32(&p->mr0) & EMAC_MR0_TXI) && n) {
			udelay(1);
			--n;
		}	
		if (unlikely(!n))
			emac_report_timeout_error(dev, "TX disable timeout");
	}
@@ -248,9 +258,11 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
	if (!(r & EMAC_MR0_RXE)) {
		if (unlikely(!(r & EMAC_MR0_RXI))) {
			/* Wait if previous async disable is still in progress */
			int n = 100;
			while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
			int n = dev->stop_timeout;
			while (!(r = in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
				udelay(1);
				--n;
			}	
			if (unlikely(!n))
				emac_report_timeout_error(dev,
							  "RX disable timeout");
@@ -273,10 +285,12 @@ static void emac_rx_disable(struct ocp_enet_private *dev)

	r = in_be32(&p->mr0);
	if (r & EMAC_MR0_RXE) {
		int n = 300;
		int n = dev->stop_timeout;
		out_be32(&p->mr0, r & ~EMAC_MR0_RXE);
		while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n)
		while (!(in_be32(&p->mr0) & EMAC_MR0_RXI) && n) {
			udelay(1);
			--n;
		}	
		if (unlikely(!n))
			emac_report_timeout_error(dev, "RX disable timeout");
	}
@@ -395,6 +409,7 @@ static int emac_configure(struct ocp_enet_private *dev)
	r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
	if (dev->phy.duplex == DUPLEX_FULL)
		r |= EMAC_MR1_FDE;
	dev->stop_timeout = STOP_TIMEOUT_10;
	switch (dev->phy.speed) {
	case SPEED_1000:
		if (emac_phy_gpcs(dev->phy.mode)) {
@@ -410,11 +425,15 @@ static int emac_configure(struct ocp_enet_private *dev)
		r |= EMAC_MR1_RFS_16K;
		gige = 1;

		if (dev->ndev->mtu > ETH_DATA_LEN)
		if (dev->ndev->mtu > ETH_DATA_LEN) {
			r |= EMAC_MR1_JPSM;
			dev->stop_timeout = STOP_TIMEOUT_1000_JUMBO;
		} else
			dev->stop_timeout = STOP_TIMEOUT_1000;
		break;
	case SPEED_100:
		r |= EMAC_MR1_MF_100;
		dev->stop_timeout = STOP_TIMEOUT_100;
		/* Fall through */
	default:
		r |= EMAC_MR1_RFS_4K;
@@ -2048,6 +2067,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
	dev->phy.duplex = DUPLEX_FULL;
	dev->phy.autoneg = AUTONEG_DISABLE;
	dev->phy.pause = dev->phy.asym_pause = 0;
	dev->stop_timeout = STOP_TIMEOUT_100;
	init_timer(&dev->link_timer);
	dev->link_timer.function = emac_link_timer;
	dev->link_timer.data = (unsigned long)dev;
+2 −0
Original line number Diff line number Diff line
@@ -189,6 +189,8 @@ struct ocp_enet_private {
	struct timer_list		link_timer;
	int				reset_failed;

	int				stop_timeout;	/* in us */

	struct ibm_emac_error_stats	estats;
	struct net_device_stats		nstats;

+2 −2
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ static int __init jazz_sonic_init_module(void)
	}

	jazz_sonic_device = platform_device_alloc(jazz_sonic_string, 0);
	if (!jazz_sonnic_device)
	if (!jazz_sonic_device)
		goto out_unregister;

	if (platform_device_add(jazz_sonic_device)) {
@@ -307,7 +307,7 @@ static int __init jazz_sonic_init_module(void)
	return 0;

out_unregister:
	driver_unregister(&jazz_sonic_driver);
	platform_driver_unregister(&jazz_sonic_driver);

	return -ENOMEM;
}
Loading