Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Conflicts:
	drivers/net/ethernet/freescale/fsl_pq_mdio.c
	net/batman-adv/translation-table.c
	net/ipv6/route.c
  • Loading branch information
David S. Miller committed Dec 16, 2011
2 parents bcebcc4 + bb3c368 commit b26e478
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 75 deletions.
11 changes: 7 additions & 4 deletions drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ struct fec_enet_private {
struct platform_device *pdev;

int opened;
int dev_id;

/* Phylib and MDIO interface */
struct mii_bus *mii_bus;
Expand Down Expand Up @@ -842,7 +843,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)

/* Adjust MAC if using macaddr */
if (iap == macaddr)
ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->pdev->id;
ndev->dev_addr[ETH_ALEN-1] = macaddr[ETH_ALEN-1] + fep->dev_id;
}

/* ------------------------------------------------------------------------- */
Expand Down Expand Up @@ -960,7 +961,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
char mdio_bus_id[MII_BUS_ID_SIZE];
char phy_name[MII_BUS_ID_SIZE + 3];
int phy_id;
int dev_id = fep->pdev->id;
int dev_id = fep->dev_id;

fep->phy_dev = NULL;

Expand Down Expand Up @@ -1040,7 +1041,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
* mdio interface in board design, and need to be configured by
* fec0 mii_bus.
*/
if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) {
/* fec1 uses fec0 mii_bus */
if (mii_cnt && fec0_mii_bus) {
fep->mii_bus = fec0_mii_bus;
Expand Down Expand Up @@ -1076,7 +1077,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
fep->mii_bus->read = fec_enet_mdio_read;
fep->mii_bus->write = fec_enet_mdio_write;
fep->mii_bus->reset = fec_enet_mdio_reset;
snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", pdev->id + 1);
snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%x", fep->dev_id + 1);
fep->mii_bus->priv = fep;
fep->mii_bus->parent = &pdev->dev;

Expand Down Expand Up @@ -1536,6 +1537,7 @@ fec_probe(struct platform_device *pdev)
int i, irq, ret = 0;
struct resource *r;
const struct of_device_id *of_id;
static int dev_id;

of_id = of_match_device(fec_dt_ids, &pdev->dev);
if (of_id)
Expand Down Expand Up @@ -1563,6 +1565,7 @@ fec_probe(struct platform_device *pdev)

fep->hwp = ioremap(r->start, resource_size(r));
fep->pdev = pdev;
fep->dev_id = dev_id++;

if (!fep->hwp) {
ret = -ENOMEM;
Expand Down
13 changes: 6 additions & 7 deletions drivers/net/ethernet/freescale/fsl_pq_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,13 @@ static int fsl_pq_mdio_probe(struct platform_device *ofdev)

if (prop)
tbiaddr = *prop;
}

if (tbiaddr == -1) {
err = -EBUSY;

goto err_free_irqs;
} else {
out_be32(tbipa, tbiaddr);
}
if (tbiaddr == -1) {
err = -EBUSY;
goto err_free_irqs;
} else {
out_be32(tbipa, tbiaddr);
}

err = of_mdiobus_register(new_bus, np);
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ppp/pptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,8 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
lock_sock(sk);

opt->src_addr = sp->sa_addr.pptp;
if (add_chan(po)) {
release_sock(sk);
if (add_chan(po))
error = -EBUSY;
}

release_sock(sk);
return error;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
ath_start_ani(common);
}

if (ath9k_hw_ops(ah)->antdiv_comb_conf_get && sc->ant_rx != 3) {
if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx != 3) {
struct ath_hw_antcomb_conf div_ant_conf;
u8 lna_conf;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192ce/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
}
case ERFSLEEP:{
if (ppsc->rfpwr_state == ERFOFF)
break;
return false;
for (queue_id = 0, i = 0;
queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
ring = &pcipriv->dev.tx_ring[queue_id];
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192cu/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
break;
case ERFSLEEP:
if (ppsc->rfpwr_state == ERFOFF)
break;
return false;
for (queue_id = 0, i = 0;
queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
ring = &pcipriv->dev.tx_ring[queue_id];
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192de/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3374,7 +3374,7 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
break;
case ERFSLEEP:
if (ppsc->rfpwr_state == ERFOFF)
break;
return false;

for (queue_id = 0, i = 0;
queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192se/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
}
case ERFSLEEP:
if (ppsc->rfpwr_state == ERFOFF)
break;
return false;

for (queue_id = 0, i = 0;
queue_id < RTL_PCI_MAX_TX_QUEUE_COUNT;) {
Expand Down
8 changes: 6 additions & 2 deletions drivers/ssb/driver_pcicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,14 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)

static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
{
ssb_pcicore_fix_sprom_core_index(pc);
struct ssb_device *pdev = pc->dev;
struct ssb_bus *bus = pdev->bus;

if (bus->bustype == SSB_BUSTYPE_PCI)
ssb_pcicore_fix_sprom_core_index(pc);

/* Disable PCI interrupts. */
ssb_write32(pc->dev, SSB_INTVEC, 0);
ssb_write32(pdev, SSB_INTVEC, 0);

/* Additional PCIe always once-executed workarounds */
if (pc->dev->id.coreid == SSB_DEV_PCIE) {
Expand Down
24 changes: 20 additions & 4 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
if (tt_global_entry) {
/* This node is probably going to update its tt table */
tt_global_entry->orig_node->tt_poss_change = true;
/* The global entry has to be marked as PENDING and has to be
/* The global entry has to be marked as ROAMING and has to be
* kept for consistency purpose */
tt_global_entry->common.flags |= TT_CLIENT_PENDING;
tt_global_entry->roam_at = jiffies;
send_roam_adv(bat_priv, tt_global_entry->common.addr,
tt_global_entry->orig_node);
}
Expand Down Expand Up @@ -661,22 +662,37 @@ void tt_global_del(struct bat_priv *bat_priv,
const char *message, bool roaming)
{
struct tt_global_entry *tt_global_entry = NULL;
struct tt_local_entry *tt_local_entry = NULL;

tt_global_entry = tt_global_hash_find(bat_priv, addr);
if (!tt_global_entry)
goto out;

if (tt_global_entry->orig_node == orig_node) {
if (roaming) {
tt_global_entry->common.flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
/* if we are deleting a global entry due to a roam
* event, there are two possibilities:
* 1) the client roamed from node A to node B => we mark
* it with TT_CLIENT_ROAM, we start a timer and we
* wait for node B to claim it. In case of timeout
* the entry is purged.
* 2) the client roamed to us => we can directly delete
* the global entry, since it is useless now. */
tt_local_entry = tt_local_hash_find(bat_priv,
tt_global_entry->common.addr);
if (!tt_local_entry) {
tt_global_entry->common.flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
}
}
_tt_global_del(bat_priv, tt_global_entry, message);
}
out:
if (tt_global_entry)
tt_global_entry_free_ref(tt_global_entry);
if (tt_local_entry)
tt_local_entry_free_ref(tt_local_entry);
}

void tt_global_del_orig(struct bat_priv *bat_priv,
Expand Down
7 changes: 6 additions & 1 deletion net/ipv4/ipip.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net,
if (register_netdevice(dev) < 0)
goto failed_free;

strcpy(nt->parms.name, dev->name);

dev_hold(dev);
ipip_tunnel_link(ipn, nt);
return nt;
Expand Down Expand Up @@ -759,7 +761,6 @@ static int ipip_tunnel_init(struct net_device *dev)
struct ip_tunnel *tunnel = netdev_priv(dev);

tunnel->dev = dev;
strcpy(tunnel->parms.name, dev->name);

memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
Expand Down Expand Up @@ -825,6 +826,7 @@ static void ipip_destroy_tunnels(struct ipip_net *ipn, struct list_head *head)
static int __net_init ipip_init_net(struct net *net)
{
struct ipip_net *ipn = net_generic(net, ipip_net_id);
struct ip_tunnel *t;
int err;

ipn->tunnels[0] = ipn->tunnels_wc;
Expand All @@ -848,6 +850,9 @@ static int __net_init ipip_init_net(struct net *net)
if ((err = register_netdev(ipn->fb_tunnel_dev)))
goto err_reg_dev;

t = netdev_priv(ipn->fb_tunnel_dev);

strcpy(t->parms.name, ipn->fb_tunnel_dev->name);
return 0;

err_reg_dev:
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,8 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
return ERR_PTR(-EACCES);

/* Add default multicast route */
addrconf_add_mroute(dev);
if (!(dev->flags & IFF_LOOPBACK))
addrconf_add_mroute(dev);

/* Add link local route */
addrconf_add_lroute(dev);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort,
int attempts = !in_softirq();

if (!(rt->rt6i_flags & RTF_GATEWAY)) {
if (rt->rt6i_dst.plen != 128 &&
if (ort->rt6i_dst.plen != 128 &&
ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
rt->rt6i_flags |= RTF_ANYCAST;
rt->rt6i_gateway = *daddr;
Expand Down
7 changes: 6 additions & 1 deletion net/ipv6/sit.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net,
if (register_netdevice(dev) < 0)
goto failed_free;

strcpy(nt->parms.name, dev->name);

dev_hold(dev);

ipip6_tunnel_link(sitn, nt);
Expand Down Expand Up @@ -1144,7 +1146,6 @@ static int ipip6_tunnel_init(struct net_device *dev)
struct ip_tunnel *tunnel = netdev_priv(dev);

tunnel->dev = dev;
strcpy(tunnel->parms.name, dev->name);

memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
Expand Down Expand Up @@ -1207,6 +1208,7 @@ static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_hea
static int __net_init sit_init_net(struct net *net)
{
struct sit_net *sitn = net_generic(net, sit_net_id);
struct ip_tunnel *t;
int err;

sitn->tunnels[0] = sitn->tunnels_wc;
Expand All @@ -1231,6 +1233,9 @@ static int __net_init sit_init_net(struct net *net)
if ((err = register_netdev(sitn->fb_tunnel_dev)))
goto err_reg_dev;

t = netdev_priv(sitn->fb_tunnel_dev);

strcpy(t->parms.name, sitn->fb_tunnel_dev->name);
return 0;

err_reg_dev:
Expand Down
Loading

0 comments on commit b26e478

Please sign in to comment.