/*
* Marvell 88E6060 switch driver
- * Copyright (c) 2008 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (c) 2008 Felix Fietkau <nbd@nbd.name>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License v2 as published by the
static inline u16
r16(struct phy_device *phydev, int addr, int reg)
{
- return phydev->bus->read(phydev->bus, addr, reg);
+ struct mii_bus *bus = phydev->mdio.bus;
+
+ return bus->read(bus, addr, reg);
}
static inline void
w16(struct phy_device *phydev, int addr, int reg, u16 val)
{
- phydev->bus->write(phydev->bus, addr, reg, val);
+ struct mii_bus *bus = phydev->mdio.bus;
+
+ bus->write(bus, addr, reg, val);
}
if (vlan == -1)
return;
- __vlan_hwaccel_put_tag(skb, vlan);
+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan);
}
#ifdef HEADER_MODE
dev->priv_flags |= IFF_NO_IP_ALIGN;
- dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX;
+ dev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX;
#else
- dev->features |= NETIF_F_HW_VLAN_RX;
+ dev->features |= NETIF_F_HW_VLAN_CTAG_RX;
#endif
return 0;
static int
mvswitch_fixup(struct phy_device *dev)
{
+ struct mii_bus *bus = dev->mdio.bus;
u16 reg;
- if (dev->addr != 0x10)
+ if (dev->mdio.addr != 0x10)
return 0;
- reg = dev->bus->read(dev->bus, MV_PORTREG(IDENT, 0)) & MV_IDENT_MASK;
+ reg = bus->read(bus, MV_PORTREG(IDENT, 0)) & MV_IDENT_MASK;
if (reg != MV_IDENT_VALUE)
return 0;
.config_init = &mvswitch_config_init,
.config_aneg = &mvswitch_config_aneg,
.read_status = &mvswitch_read_status,
- .driver = { .owner = THIS_MODULE,},
};
static int __init
mvswitch_init(void)
{
phy_register_fixup_for_id(PHY_ANY_ID, mvswitch_fixup);
- return phy_driver_register(&mvswitch_driver);
+ return phy_driver_register(&mvswitch_driver, THIS_MODULE);
}
static void __exit