Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19069
b: refs/heads/master
c: 3c5eca5
h: refs/heads/master
i:
  19067: 4e0e615
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Jan 30, 2006
1 parent 32ced20 commit dd9c0e8
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 69 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: b0b020d4783fbc4cc477e2ca678ac47c50d5bc3e
refs/heads/master: 3c5eca542d19cd50e9a028dc32897cd698dcc33e
4 changes: 2 additions & 2 deletions trunk/arch/ppc/syslib/mv64x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static struct platform_device mpsc1_device = {
};
#endif

#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
#ifdef CONFIG_MV643XX_ETH
static struct resource mv64x60_eth_shared_resources[] = {
[0] = {
.name = "ethernet shared base",
Expand Down Expand Up @@ -456,7 +456,7 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = {
&mpsc0_device,
&mpsc1_device,
#endif
#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
#ifdef CONFIG_MV643XX_ETH
&mv64x60_eth_shared_device,
#endif
#ifdef CONFIG_MV643XX_ETH_0
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,6 @@ static int __devinit ace_init(struct net_device *dev)

mac1 = 0;
for(i = 0; i < 4; i++) {
int tmp;

mac1 = mac1 << 8;
tmp = read_eeprom_byte(dev, 0x8c+i);
if (tmp < 0) {
Expand All @@ -1014,8 +1012,6 @@ static int __devinit ace_init(struct net_device *dev)
}
mac2 = 0;
for(i = 4; i < 8; i++) {
int tmp;

mac2 = mac2 << 8;
tmp = read_eeprom_byte(dev, 0x8c+i);
if (tmp < 0) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ static int b44_open(struct net_device *dev)
b44_init_rings(bp);
b44_init_hw(bp);

netif_carrier_off(dev);
b44_check_phy(bp);

err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
Expand Down Expand Up @@ -1463,7 +1464,7 @@ static int b44_close(struct net_device *dev)
#endif
b44_halt(bp);
b44_free_rings(bp);
netif_carrier_off(dev);
netif_carrier_off(bp->dev);

spin_unlock_irq(&bp->lock);

Expand Down Expand Up @@ -1999,8 +2000,6 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
dev->irq = pdev->irq;
SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);

netif_carrier_off(dev);

err = b44_get_invariants(bp);
if (err) {
printk(KERN_ERR PFX "Problem fetching invariants of chip, "
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ static int bond_update_speed_duplex(struct slave *slave)
slave->duplex = DUPLEX_FULL;

if (slave_dev->ethtool_ops) {
int res;
u32 res;

if (!slave_dev->ethtool_ops->get_settings) {
return -1;
Expand Down
108 changes: 61 additions & 47 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
netif_rx(skb);
#endif
}
dev->last_rx = jiffies;
}

return received_packets;
Expand All @@ -462,7 +461,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
*/

static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id,
struct pt_regs *regs)
struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *)dev_id;
struct mv643xx_private *mp = netdev_priv(dev);
Expand Down Expand Up @@ -1048,15 +1047,16 @@ static int mv643xx_poll(struct net_device *dev, int *budget)

static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb)
{
unsigned int frag;
skb_frag_t *fragp;
unsigned int frag;
skb_frag_t *fragp;

for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
fragp = &skb_shinfo(skb)->frags[frag];
if (fragp->size <= 8 && fragp->page_offset & 0x7)
return 1;
}
return 0;
for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
fragp = &skb_shinfo(skb)->frags[frag];
if (fragp->size <= 8 && fragp->page_offset & 0x7)
return 1;

}
return 0;
}


Expand Down Expand Up @@ -2137,26 +2137,26 @@ static void eth_port_set_multicast_list(struct net_device *dev)
*/
if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI)) {
for (table_index = 0; table_index <= 0xFC; table_index += 4) {
/* Set all entries in DA filter special multicast
* table (Ex_dFSMT)
* Set for ETH_Q0 for now
* Bits
* 0 Accept=1, Drop=0
* 3-1 Queue ETH_Q0=0
* 7-4 Reserved = 0;
*/
mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);

/* Set all entries in DA filter other multicast
* table (Ex_dFOMT)
* Set for ETH_Q0 for now
* Bits
* 0 Accept=1, Drop=0
* 3-1 Queue ETH_Q0=0
* 7-4 Reserved = 0;
*/
mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);
}
/* Set all entries in DA filter special multicast
* table (Ex_dFSMT)
* Set for ETH_Q0 for now
* Bits
* 0 Accept=1, Drop=0
* 3-1 Queue ETH_Q0=0
* 7-4 Reserved = 0;
*/
mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);

/* Set all entries in DA filter other multicast
* table (Ex_dFOMT)
* Set for ETH_Q0 for now
* Bits
* 0 Accept=1, Drop=0
* 3-1 Queue ETH_Q0=0
* 7-4 Reserved = 0;
*/
mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);
}
return;
}

Expand Down Expand Up @@ -2617,6 +2617,7 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
struct eth_tx_desc *current_descriptor;
struct eth_tx_desc *first_descriptor;
u32 command;
unsigned long flags;

/* Do not process Tx ring in case of Tx ring resource error */
if (mp->tx_resource_err)
Expand All @@ -2633,6 +2634,8 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
return ETH_ERROR;
}

spin_lock_irqsave(&mp->lock, flags);

mp->tx_ring_skbs++;
BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);

Expand Down Expand Up @@ -2682,11 +2685,15 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
mp->tx_resource_err = 1;
mp->tx_curr_desc_q = tx_first_desc;

spin_unlock_irqrestore(&mp->lock, flags);

return ETH_QUEUE_LAST_RESOURCE;
}

mp->tx_curr_desc_q = tx_next_desc;

spin_unlock_irqrestore(&mp->lock, flags);

return ETH_OK;
}
#else
Expand All @@ -2697,11 +2704,14 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
int tx_desc_used;
struct eth_tx_desc *current_descriptor;
unsigned int command_status;
unsigned long flags;

/* Do not process Tx ring in case of Tx ring resource error */
if (mp->tx_resource_err)
return ETH_QUEUE_FULL;

spin_lock_irqsave(&mp->lock, flags);

mp->tx_ring_skbs++;
BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);

Expand Down Expand Up @@ -2732,9 +2742,12 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
/* Check for ring index overlap in the Tx desc ring */
if (tx_desc_curr == tx_desc_used) {
mp->tx_resource_err = 1;

spin_unlock_irqrestore(&mp->lock, flags);
return ETH_QUEUE_LAST_RESOURCE;
}

spin_unlock_irqrestore(&mp->lock, flags);
return ETH_OK;
}
#endif
Expand Down Expand Up @@ -2885,10 +2898,8 @@ static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp,
p_pkt_info->return_info = mp->rx_skb[rx_curr_desc];
p_pkt_info->l4i_chk = p_rx_desc->buf_size;

/*
* Clean the return info field to indicate that the
* packet has been moved to the upper layers
*/
/* Clean the return info field to indicate that the packet has been */
/* moved to the upper layers */
mp->rx_skb[rx_curr_desc] = NULL;

/* Update current index in data structure */
Expand Down Expand Up @@ -2969,7 +2980,7 @@ struct mv643xx_stats {
};

#define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \
offsetof(struct mv643xx_private, m)
offsetof(struct mv643xx_private, m)

static const struct mv643xx_stats mv643xx_gstrings_stats[] = {
{ "rx_packets", MV643XX_STAT(stats.rx_packets) },
Expand Down Expand Up @@ -3120,8 +3131,9 @@ mv643xx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
return 0;
}

static void mv643xx_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo)
static void
mv643xx_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo)
{
strncpy(drvinfo->driver, mv643xx_driver_name, 32);
strncpy(drvinfo->version, mv643xx_driver_version, 32);
Expand All @@ -3130,37 +3142,39 @@ static void mv643xx_get_drvinfo(struct net_device *netdev,
drvinfo->n_stats = MV643XX_STATS_LEN;
}

static int mv643xx_get_stats_count(struct net_device *netdev)
static int
mv643xx_get_stats_count(struct net_device *netdev)
{
return MV643XX_STATS_LEN;
}

static void mv643xx_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data)
static void
mv643xx_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats, uint64_t *data)
{
struct mv643xx_private *mp = netdev->priv;
int i;

eth_update_mib_counters(mp);

for (i = 0; i < MV643XX_STATS_LEN; i++) {
for(i = 0; i < MV643XX_STATS_LEN; i++) {
char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset;
data[i] = (mv643xx_gstrings_stats[i].sizeof_stat ==
data[i] = (mv643xx_gstrings_stats[i].sizeof_stat ==
sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
}
}

static void mv643xx_get_strings(struct net_device *netdev, uint32_t stringset,
uint8_t *data)
static void
mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
{
int i;

switch(stringset) {
case ETH_SS_STATS:
for (i=0; i < MV643XX_STATS_LEN; i++) {
memcpy(data + i * ETH_GSTRING_LEN,
mv643xx_gstrings_stats[i].stat_string,
ETH_GSTRING_LEN);
memcpy(data + i * ETH_GSTRING_LEN,
mv643xx_gstrings_stats[i].stat_string,
ETH_GSTRING_LEN);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3586,7 +3586,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
txdp->Buffer_Pointer = (u64) pci_map_page
(sp->pdev, frag->page, frag->page_offset,
frag->size, PCI_DMA_TODEVICE);
txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
txdp->Control_1 |= TXD_BUFFER0_SIZE(frag->size);
if (skb_shinfo(skb)->ufo_size)
txdp->Control_1 |= TXD_UFO_EN;
}
Expand Down
22 changes: 12 additions & 10 deletions trunk/drivers/net/wireless/ipw2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,17 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv,
#define SEARCH_SNAPSHOT 1

#define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff))
static void ipw2100_snapshot_free(struct ipw2100_priv *priv)
{
int i;
if (!priv->snapshot[0])
return;
for (i = 0; i < 0x30; i++)
kfree(priv->snapshot[i]);
priv->snapshot[0] = NULL;
}

#ifdef CONFIG_IPW2100_DEBUG_C3
static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
{
int i;
Expand All @@ -2221,16 +2232,6 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
return 1;
}

static void ipw2100_snapshot_free(struct ipw2100_priv *priv)
{
int i;
if (!priv->snapshot[0])
return;
for (i = 0; i < 0x30; i++)
kfree(priv->snapshot[i]);
priv->snapshot[0] = NULL;
}

static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,
size_t len, int mode)
{
Expand Down Expand Up @@ -2269,6 +2270,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,

return ret;
}
#endif

/*
*
Expand Down

0 comments on commit dd9c0e8

Please sign in to comment.