1/* 2 * Driver for Moschip MCS814x internal PHY 3 * 4 * Copyright (c) 2012 Florian Fainelli <florian@openwrt.org> 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the 8 * Free Software Foundation; either version 2 of the License, or (at your 9 * option) any later version. 10 * 11 */ 12#include <linux/kernel.h> 13#include <linux/string.h> 14#include <linux/errno.h> 15#include <linux/unistd.h> 16#include <linux/interrupt.h> 17#include <linux/init.h> 18#include <linux/delay.h> 19#include <linux/netdevice.h> 20#include <linux/etherdevice.h> 21#include <linux/skbuff.h> 22#include <linux/spinlock.h> 23#include <linux/mm.h> 24#include <linux/module.h> 25#include <linux/mii.h> 26#include <linux/ethtool.h> 27#include <linux/phy.h> 28 29MODULE_DESCRIPTION("Moschip MCS814x PHY driver"); 30MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); 31MODULE_LICENSE("GPL"); 32 33/* Nothing special about this PHY but its OUI (O) */ 34static struct phy_driver mcs8140_driver = { 35 .phy_id = 0, 36 .name = "Moschip MCS8140", 37 .phy_id_mask = 0x02, 38 .features = PHY_BASIC_FEATURES, 39 .config_aneg = &genphy_config_aneg, 40 .read_status = &genphy_read_status, 41 .suspend = genphy_suspend, 42 .resume = genphy_resume, 43 .driver = { .owner = THIS_MODULE,}, 44}; 45 46static int __init mcs814x_phy_init(void) 47{ 48 return phy_driver_register(&mcs8140_driver); 49} 50 51static void __exit mcs814x_phy_exit(void) 52{ 53 phy_driver_unregister(&mcs8140_driver); 54} 55 56module_init(mcs814x_phy_init); 57module_exit(mcs814x_phy_exit); 58 59static struct mdio_device_id __maybe_unused mcs814x_phy_tbl[] = { 60 { 0x0, 0x0ffffff0 }, 61 { } 62}; 63 64MODULE_DEVICE_TABLE(mdio, mcs814x_phy_tbl); 65