/*------------------------------------------------------------------------------------------*\ * Copyright (C) 2016 AVM GmbH * * 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 version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \*------------------------------------------------------------------------------------------*/ #ifndef DRIVERS_NET_AVM_CPMAC_SYNOPSYS_H_ #define DRIVERS_NET_AVM_CPMAC_SYNOPSYS_H_ #include #include enum syn_state { syn_state_init, syn_state_up, syn_state_err, }; struct avmnet_synopsys_context { struct avmnet_master_dev master; struct net_device *mdio_dev; enum syn_state state; struct socket *sock; unsigned int mdio_bus; int (*mdio_write)(void *pdata, int mdionum, int phyaddr, int phyreg, int phydata); int (*mdio_read)(void *pdata, int mdionum, int phyaddr, int phyreg, int *phydata); int (*gbe_update_cluster_speed)(struct net_device *dev, unsigned int speed, unsigned int duplex, char* devName, unsigned int flags); }; extern int avmnet_synopsys_init(avmnet_module_t *this); extern int avmnet_synopsys_setup(avmnet_module_t *this); extern int avmnet_synopsys_exit(avmnet_module_t *this); extern int avmnet_synopsys_setup_irq(avmnet_module_t *this , unsigned int on); extern unsigned int avmnet_synopsys_reg_read(avmnet_module_t *this, unsigned int addr, unsigned int reg); extern int avmnet_synopsys_reg_write(avmnet_module_t *this, unsigned int addr, unsigned int reg, unsigned int data); extern int avmnet_synopsys_lock(avmnet_module_t *this); extern void avmnet_synopsys_unlock(avmnet_module_t *this); extern int avmnet_synopsys_trylock(avmnet_module_t *this); extern void avmnet_synopsys_status_changed(avmnet_module_t *this, avmnet_module_t *caller); extern int avmnet_synopsys_set_status(avmnet_module_t *this, avmnet_device_t *device_id, avmnet_linkstatus_t status); extern int avmnet_synopsys_poll(avmnet_module_t *this); extern int avmnet_synopsys_powerdown(avmnet_module_t *this); extern int avmnet_synopsys_powerup(avmnet_module_t *this); extern int avmnet_synopsys_suspend(avmnet_module_t *this, avmnet_module_t *caller); extern int avmnet_synopsys_resume(avmnet_module_t *this, avmnet_module_t *caller); extern int avmnet_synopsys_reinit(avmnet_module_t *this); #endif /* DRIVERS_NET_AVM_CPMAC_SWITCH_VLAN_MASTER_VLAN_MASTER_H_ */