Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323172
b: refs/heads/master
c: 41e2685
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 25, 2012
1 parent c7a04b3 commit 72d4370
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 30 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: 1199992df2417dc9a1db1b19930ea4d0a697a61e
refs/heads/master: 41e268565a1f597b3d8f37d8075e6be7e40fd8f9
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-mxs/mach-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void __init apx4devkit_init(void)
enable_clk_enet_out();

if (IS_BUILTIN(CONFIG_PHYLIB))
phy_register_fixup_for_uid(PHY_ID_KS8051, MICREL_PHY_ID_MASK,
phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK,
apx4devkit_phy_fixup);

mxsfb_pdata.mode_list = apx4devkit_video_modes;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/phy/bcm87xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,5 @@ static void __exit bcm87xx_exit(void)
ARRAY_SIZE(bcm87xx_driver));
}
module_exit(bcm87xx_exit);

MODULE_LICENSE("GPL");
45 changes: 36 additions & 9 deletions trunk/drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <linux/phy.h>
#include <linux/micrel_phy.h>

/* Operation Mode Strap Override */
#define MII_KSZPHY_OMSO 0x16
#define KSZPHY_OMSO_B_CAST_OFF (1 << 9)
#define KSZPHY_OMSO_RMII_OVERRIDE (1 << 1)
#define KSZPHY_OMSO_MII_OVERRIDE (1 << 0)

/* general Interrupt control/status reg in vendor specific block. */
#define MII_KSZPHY_INTCS 0x1B
#define KSZPHY_INTCS_JABBER (1 << 15)
Expand Down Expand Up @@ -101,6 +107,13 @@ static int kszphy_config_init(struct phy_device *phydev)
return 0;
}

static int ksz8021_config_init(struct phy_device *phydev)
{
const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE;
phy_write(phydev, MII_KSZPHY_OMSO, val);
return 0;
}

static int ks8051_config_init(struct phy_device *phydev)
{
int regval;
Expand Down Expand Up @@ -128,9 +141,22 @@ static struct phy_driver ksphy_driver[] = {
.config_intr = ks8737_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KS8041,
.phy_id = PHY_ID_KSZ8021,
.phy_id_mask = 0x00ffffff,
.name = "Micrel KSZ8021",
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
SUPPORTED_Asym_Pause),
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init = ksz8021_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KSZ8041,
.phy_id_mask = 0x00fffff0,
.name = "Micrel KS8041",
.name = "Micrel KSZ8041",
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause
| SUPPORTED_Asym_Pause),
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
Expand All @@ -141,9 +167,9 @@ static struct phy_driver ksphy_driver[] = {
.config_intr = kszphy_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KS8051,
.phy_id = PHY_ID_KSZ8051,
.phy_id_mask = 0x00fffff0,
.name = "Micrel KS8051",
.name = "Micrel KSZ8051",
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause
| SUPPORTED_Asym_Pause),
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
Expand All @@ -154,8 +180,8 @@ static struct phy_driver ksphy_driver[] = {
.config_intr = kszphy_config_intr,
.driver = { .owner = THIS_MODULE,},
}, {
.phy_id = PHY_ID_KS8001,
.name = "Micrel KS8001 or KS8721",
.phy_id = PHY_ID_KSZ8001,
.name = "Micrel KSZ8001 or KS8721",
.phy_id_mask = 0x00ffffff,
.features = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
Expand Down Expand Up @@ -201,10 +227,11 @@ MODULE_LICENSE("GPL");

static struct mdio_device_id __maybe_unused micrel_tbl[] = {
{ PHY_ID_KSZ9021, 0x000ffffe },
{ PHY_ID_KS8001, 0x00ffffff },
{ PHY_ID_KSZ8001, 0x00ffffff },
{ PHY_ID_KS8737, 0x00fffff0 },
{ PHY_ID_KS8041, 0x00fffff0 },
{ PHY_ID_KS8051, 0x00fffff0 },
{ PHY_ID_KSZ8021, 0x00ffffff },
{ PHY_ID_KSZ8041, 0x00fffff0 },
{ PHY_ID_KSZ8051, 0x00fffff0 },
{ }
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ppp/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ static int pppoe_release(struct socket *sock)

po = pppox_sk(sk);

if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
dev_put(po->pppoe_dev);
po->pppoe_dev = NULL;
}
Expand Down
32 changes: 24 additions & 8 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ static struct netpoll_info *team_netpoll_info(struct team *team)
}
#endif

static void __team_port_change_check(struct team_port *port, bool linkup);
static void __team_port_change_port_added(struct team_port *port, bool linkup);

static int team_port_add(struct team *team, struct net_device *port_dev)
{
Expand Down Expand Up @@ -948,7 +948,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
team_port_enable(team, port);
list_add_tail_rcu(&port->list, &team->port_list);
__team_compute_features(team);
__team_port_change_check(port, !!netif_carrier_ok(port_dev));
__team_port_change_port_added(port, !!netif_carrier_ok(port_dev));
__team_options_change_check(team);

netdev_info(dev, "Port device %s added\n", portname);
Expand Down Expand Up @@ -983,6 +983,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
return err;
}

static void __team_port_change_port_removed(struct team_port *port);

static int team_port_del(struct team *team, struct net_device *port_dev)
{
struct net_device *dev = team->dev;
Expand All @@ -999,8 +1001,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
__team_option_inst_mark_removed_port(team, port);
__team_options_change_check(team);
__team_option_inst_del_port(team, port);
port->removed = true;
__team_port_change_check(port, false);
__team_port_change_port_removed(port);
team_port_disable(team, port);
list_del_rcu(&port->list);
netdev_rx_handler_unregister(port_dev);
Expand Down Expand Up @@ -2251,13 +2252,11 @@ static void __team_options_change_check(struct team *team)
}

/* rtnl lock is held */
static void __team_port_change_check(struct team_port *port, bool linkup)

static void __team_port_change_send(struct team_port *port, bool linkup)
{
int err;

if (!port->removed && port->state.linkup == linkup)
return;

port->changed = true;
port->state.linkup = linkup;
team_refresh_port_linkup(port);
Expand All @@ -2282,6 +2281,23 @@ static void __team_port_change_check(struct team_port *port, bool linkup)

}

static void __team_port_change_check(struct team_port *port, bool linkup)
{
if (port->state.linkup != linkup)
__team_port_change_send(port, linkup);
}

static void __team_port_change_port_added(struct team_port *port, bool linkup)
{
__team_port_change_send(port, linkup);
}

static void __team_port_change_port_removed(struct team_port *port)
{
port->removed = true;
__team_port_change_send(port, false);
}

static void team_port_change_check(struct team_port *port, bool linkup)
{
struct team *team = port->team;
Expand Down
19 changes: 16 additions & 3 deletions trunk/include/linux/micrel_phy.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
/*
* include/linux/micrel_phy.h
*
* Micrel PHY IDs
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
*/

#ifndef _MICREL_PHY_H
#define _MICREL_PHY_H

#define MICREL_PHY_ID_MASK 0x00fffff0

#define PHY_ID_KSZ9021 0x00221610
#define PHY_ID_KS8737 0x00221720
#define PHY_ID_KS8041 0x00221510
#define PHY_ID_KS8051 0x00221550
#define PHY_ID_KSZ8021 0x00221555
#define PHY_ID_KSZ8041 0x00221510
#define PHY_ID_KSZ8051 0x00221550
/* both for ks8001 Rev. A/B, and for ks8721 Rev 3. */
#define PHY_ID_KS8001 0x0022161A
#define PHY_ID_KSZ8001 0x0022161A

/* struct phy_device dev_flags definitions */
#define MICREL_PHY_50MHZ_CLK 0x00000001
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,8 @@ int sock_setsockopt(struct socket *sock, int level, int optname,

case SO_KEEPALIVE:
#ifdef CONFIG_INET
if (sk->sk_protocol == IPPROTO_TCP)
if (sk->sk_protocol == IPPROTO_TCP &&
sk->sk_type == SOCK_STREAM)
tcp_set_keepalive(sk, valbool);
#endif
sock_valbool_flag(sk, SOCK_KEEPOPEN, valbool);
Expand Down
14 changes: 8 additions & 6 deletions trunk/net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,20 @@ static struct sock *__raw_v4_lookup(struct net *net, struct sock *sk,
* 0 - deliver
* 1 - block
*/
static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
static int icmp_filter(const struct sock *sk, const struct sk_buff *skb)
{
int type;
struct icmphdr _hdr;
const struct icmphdr *hdr;

if (!pskb_may_pull(skb, sizeof(struct icmphdr)))
hdr = skb_header_pointer(skb, skb_transport_offset(skb),
sizeof(_hdr), &_hdr);
if (!hdr)
return 1;

type = icmp_hdr(skb)->type;
if (type < 32) {
if (hdr->type < 32) {
__u32 data = raw_sk(sk)->filter.data;

return ((1 << type) & data) != 0;
return ((1U << hdr->type) & data) != 0;
}

/* Do not block unknown ICMP types */
Expand Down

0 comments on commit 72d4370

Please sign in to comment.