last of the namespace cleanups
Subsystems (5)
cover last of the namespace cleanups
These are the last of the cleanups to networking for 2.6.37 based on "make namespacecheck" reports.
PATCH 1/12 l2tp: make local function static
Also moved the refcound inlines from l2tp_core.h to l2tp_core.c since only used in that one file.
--- net/l2tp/l2tp_core.c | 50 ++++++++++++++++++++++++++++++++++++++++---------- net/l2tp/l2tp_core.h | 33 --------------------------------- net/l2tp/l2tp_ip.c | 2 +- 3 files changed, 41 insertions(+), 44 deletions(-)
net/l2tp/l2tp_core.c +40 -10
@@ -111,6 +111,10 @@ struct l2tp_net {spinlock_t l2tp_session_hlist_lock; }; +static void l2tp_session_set_header_len (struct l2tp_session *session,int version); +static void l2tp_tunnel_free (struct l2tp_tunnel *tunnel); +static void l2tp_tunnel_closeall (struct l2tp_tunnel *tunnel); +static inline struct l2tp_net *l2tp_pernet (struct net *net) {BUG_ON (!net);
@@ -118,6 +122,34 @@ static inline struct l2tp_net *l2tp_pernreturn net_generic (net, l2tp_net_id); } + +/* Tunnel reference counts. Incremented per session that is added to +* the tunnel. +*/ +static inline void l2tp_tunnel_inc_refcount_1 (struct l2tp_tunnel *tunnel) +{ +atomic_inc (&tunnel->ref_count); +} + +static inline void l2tp_tunnel_dec_refcount_1 (struct l2tp_tunnel *tunnel) +{ +if (atomic_dec_and_test (&tunnel->ref_count)) +l2tp_tunnel_free (tunnel); +} +#ifdef L2TP_REFCNT_DEBUG +#define l2tp_tunnel_inc_refcount (_t) do { \ + printk(KERN_DEBUG "l2tp_tunnel_inc_refcount: %s:%d %s: cnt=%d\n", __func__, __LINE__, (_t)->name, atomic_read(&_t->ref_count)); \ + l2tp_tunnel_inc_refcount_1(_t); \ + } while (0) +#define l2tp_tunnel_dec_refcount (_t) do { \ + printk(KERN_DEBUG "l2tp_tunnel_dec_refcount: %s:%d %s: cnt=%d\n", __func__, __LINE__, (_t)->name, atomic_read(&_t->ref_count)); \ + l2tp_tunnel_dec_refcount_1(_t); \ + } while (0) +#else +#define l2tp_tunnel_inc_refcount (t) l2tp_tunnel_inc_refcount_1(t) +#define l2tp_tunnel_dec_refcount (t) l2tp_tunnel_dec_refcount_1(t) +#endif +/* Session hash global list for L2TPv3. * The session_id SHOULD be random according to RFC3931, but several * L2TP implementations use incrementing session_ids. So we do a real
@@ -699,8 +731,8 @@ EXPORT_SYMBOL(l2tp_recv_common);* Returns 1 if the packet was not a good data packet and could not be * forwarded. All such packets are passed up to userspace to deal with. */ -int l2tp_udp_recv_core (struct l2tp_tunnel *tunnel,struct sk_buff *skb, -int (*payload_hook)(struct sk_buff *skb)) +static int l2tp_udp_recv_core (struct l2tp_tunnel *tunnel,struct sk_buff *skb, +int (*payload_hook)(struct sk_buff *skb)) {struct l2tp_session *session =NULL ;unsigned char *ptr, *optr;
@@ -922,7 +954,8 @@ static int l2tp_build_l2tpv3_header(strureturn bufp - optr; } -int l2tp_xmit_core (struct l2tp_session *session,struct sk_buff *skb,size_t data_len) +static int l2tp_xmit_core (struct l2tp_session *session,struct sk_buff *skb, +size_t data_len) {struct l2tp_tunnel *tunnel = session->tunnel;unsigned int len = skb->len;
@@ -1089,7 +1122,7 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);* The tunnel context is deleted only when all session sockets have been * closed. */ -void l2tp_tunnel_destruct (struct sock *sk) +static void l2tp_tunnel_destruct (struct sock *sk) {struct l2tp_tunnel *tunnel;
@@ -1128,11 +1161,10 @@ void l2tp_tunnel_destruct(struct sock *s end:return ; } -EXPORT_SYMBOL (l2tp_tunnel_destruct);/* When the tunnel is closed, all the attached sessions need to go too. */ -void l2tp_tunnel_closeall (struct l2tp_tunnel *tunnel) +static void l2tp_tunnel_closeall (struct l2tp_tunnel *tunnel) {int hash;struct hlist_node *walk;
@@ -1198,7 +1230,7 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_closeall);/* Really kill the tunnel. * Come here only when all sessions have been cleared from the tunnel. */ -void l2tp_tunnel_free (struct l2tp_tunnel *tunnel) +static void l2tp_tunnel_free (struct l2tp_tunnel *tunnel) {struct l2tp_net *pn =l2tp_pernet (tunnel->l2tp_net);
@@ -1217,7 +1249,6 @@ void l2tp_tunnel_free(struct l2tp_tunnelatomic_dec (&l2tp_tunnel_count);kfree (tunnel); } -EXPORT_SYMBOL_GPL (l2tp_tunnel_free);/* Create a socket for the tunnel, if one isn't set up by * userspace. This is used for static tunnels where there is no
@@ -1512,7 +1543,7 @@ EXPORT_SYMBOL_GPL(l2tp_session_delete);/* We come here whenever a session's send_seq, cookie_len or * l2specific_len parameters are set. */ -void l2tp_session_set_header_len (struct l2tp_session *session,int version) +static void l2tp_session_set_header_len (struct l2tp_session *session,int version) {if (version ==L2TP_HDR_VER_2 ) { session->hdr_len =6 ;
@@ -1525,7 +1556,6 @@ void l2tp_session_set_header_len(struct } } -EXPORT_SYMBOL_GPL (l2tp_session_set_header_len);struct l2tp_session *l2tp_session_create (int priv_size,struct l2tp_tunnel *tunnel,u32 session_id,u32 peer_session_id,struct l2tp_session_cfg *cfg) {
net/l2tp/l2tp_core.h +0 -33
@@ -231,48 +231,15 @@ extern int l2tp_tunnel_create(struct netextern int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel);extern struct l2tp_session *l2tp_session_create (int priv_size,struct l2tp_tunnel *tunnel,u32 session_id,u32 peer_session_id,struct l2tp_session_cfg *cfg);extern int l2tp_session_delete (struct l2tp_session *session); -extern void l2tp_tunnel_free (struct l2tp_tunnel *tunnel);extern void l2tp_session_free (struct l2tp_session *session);extern void l2tp_recv_common (struct l2tp_session *session,struct sk_buff *skb,unsigned char *ptr,unsigned char *optr,u16 hdrflags,int length,int (*payload_hook)(struct sk_buff *skb)); -extern int l2tp_udp_recv_core (struct l2tp_tunnel *tunnel,struct sk_buff *skb,int (*payload_hook)(struct sk_buff *skb));extern int l2tp_udp_encap_recv (struct sock *sk,struct sk_buff *skb); -extern int l2tp_xmit_core (struct l2tp_session *session,struct sk_buff *skb,size_t data_len);extern int l2tp_xmit_skb (struct l2tp_session *session,struct sk_buff *skb,int hdr_len); -extern void l2tp_tunnel_destruct (struct sock *sk); -extern void l2tp_tunnel_closeall (struct l2tp_tunnel *tunnel); -extern void l2tp_session_set_header_len (struct l2tp_session *session,int version);extern int l2tp_nl_register_ops (enum l2tp_pwtype pw_type,const struct l2tp_nl_cmd_ops *ops);extern void l2tp_nl_unregister_ops (enum l2tp_pwtype pw_type); -/* Tunnel reference counts. Incremented per session that is added to -* the tunnel. -*/ -static inline void l2tp_tunnel_inc_refcount_1 (struct l2tp_tunnel *tunnel) -{ -atomic_inc (&tunnel->ref_count); -} - -static inline void l2tp_tunnel_dec_refcount_1 (struct l2tp_tunnel *tunnel) -{ -if (atomic_dec_and_test (&tunnel->ref_count)) -l2tp_tunnel_free (tunnel); -} -#ifdef L2TP_REFCNT_DEBUG -#define l2tp_tunnel_inc_refcount (_t) do { \ - printk(KERN_DEBUG "l2tp_tunnel_inc_refcount: %s:%d %s: cnt=%d\n", __func__, __LINE__, (_t)->name, atomic_read(&_t->ref_count)); \ - l2tp_tunnel_inc_refcount_1(_t); \ - } while (0) -#define l2tp_tunnel_dec_refcount (_t) do { \ - printk(KERN_DEBUG "l2tp_tunnel_dec_refcount: %s:%d %s: cnt=%d\n", __func__, __LINE__, (_t)->name, atomic_read(&_t->ref_count)); \ - l2tp_tunnel_dec_refcount_1(_t); \ - } while (0) -#else -#define l2tp_tunnel_inc_refcount (t) l2tp_tunnel_inc_refcount_1(t) -#define l2tp_tunnel_dec_refcount (t) l2tp_tunnel_dec_refcount_1(t) -#endif -/* Session reference counts. Incremented when code obtains a reference * to a session. */
net/l2tp/l2tp_ip.c +1 -1
@@ -576,7 +576,7 @@ out:return copied; } -struct proto l2tp_ip_prot = { +static struct proto l2tp_ip_prot = { .name ="L2TP/IP" , .owner =THIS_MODULE , .init = l2tp_ip_open,
Re: [PATCH 01/12] l2tp: make local function static
Quoted 5 lines · Stephen Hemminger
Also moved the refcound inlines from
l2tp_core.htol2tp_core.csince only used in that one file.Signed-off-by Stephen Hemminger <[email protected]>
Signature · 4 lines
James Chapman Katalix Systems Ltd http://www.katalix.com Catalysts for your Embedded Linux software development
PATCH 2/12 benet: remove dead code
In reply to Stephen HemmingerThe following code and data are defined but never used in current driver.
drivers/net/benet/be_cmds.c +0 -36
@@ -1471,42 +1471,6 @@ err:return status; } -/* Uses sync mcc */ -int be_cmd_read_port_type (struct be_adapter *adapter,u32 port, -u8 *connector) -{ -struct be_mcc_wrb *wrb; -struct be_cmd_req_port_type *req; -int status; - -spin_lock_bh (&adapter->mcc_lock); - - wrb =wrb_from_mccq (adapter); -if (!wrb) { - status = -EBUSY ; - goto err; - } - req =embedded_payload (wrb); - -be_wrb_hdr_prepare (wrb,sizeof (struct be_cmd_resp_port_type ), true,0 , -OPCODE_COMMON_READ_TRANSRECV_DATA ); - -be_cmd_hdr_prepare (&req->hdr,CMD_SUBSYSTEM_COMMON , -OPCODE_COMMON_READ_TRANSRECV_DATA ,sizeof (*req)); - - req->port =cpu_to_le32 (port); - req->page_num =cpu_to_le32 (TR_PAGE_A0 ); - status =be_mcc_notify_wait (adapter); -if (!status) { -struct be_cmd_resp_port_type *resp =embedded_payload (wrb); - *connector = resp->data.connector; - } - -err: -spin_unlock_bh (&adapter->mcc_lock); -return status; -} -int be_cmd_write_flashrom (struct be_adapter *adapter,struct be_dma_mem *cmd,u32 flash_type,u32 flash_opcode,u32 buf_size) {
drivers/net/benet/be_cmds.h +0 -2
@@ -1022,8 +1022,6 @@ extern int be_cmd_set_beacon_state(struc u8 port_num, u8 beacon, u8 status, u8 state);extern int be_cmd_get_beacon_state (struct be_adapter *adapter,u8 port_num,u32 *state); -extern int be_cmd_read_port_type (struct be_adapter *adapter,u32 port, -u8 *connector);extern int be_cmd_write_flashrom (struct be_adapter *adapter,struct be_dma_mem *cmd,u32 flash_oper,u32 flash_opcode,u32 buf_size);
drivers/net/benet/be_main.c +0 -3
@@ -2299,9 +2299,6 @@ static int be_clear(struct be_adapter *a#define FW_FILE_HDR_SIGN "ServerEngines Corp. " -char flash_cookie[2 ][16 ] = {"*** SE FLAS" , -"H DIRECTORY *** " }; -static bool be_flash_redboot (struct be_adapter *adapter,const u8 *p,u32 img_start,int image_size,int hdr_size)
PATCH 3/12 benet: make be_poll_rx local
In reply to Stephen HemmingerOnly used in one file.
drivers/net/benet/be_main.c +1 -1
@@ -1674,7 +1674,7 @@ static inline bool do_gro(struct be_adapreturn (tcp_frame && !err) ? true : false; } -int be_poll_rx (struct napi_struct *napi,int budget) +static int be_poll_rx (struct napi_struct *napi,int budget) { struct be_eq_obj *rx_eq = container_of(napi, struct be_eq_obj, napi); struct be_rx_obj *rxo = container_of(rx_eq, struct be_rx_obj, rx_eq);
PATCH 4/12 atl1c: make functions static
In reply to Stephen HemmingerThe up/down are only used in this file.
drivers/net/atl1c/atl1c.h +0 -2
@@ -631,8 +631,6 @@ struct atl1c_adapter {extern char atl1c_driver_name[];extern char atl1c_driver_version[]; -extern int atl1c_up (struct atl1c_adapter *adapter); -extern void atl1c_down (struct atl1c_adapter *adapter);extern void atl1c_reinit_locked (struct atl1c_adapter *adapter);extern s32 atl1c_reset_hw (struct atl1c_hw *hw);extern void atl1c_set_ethtool_ops (struct net_device *netdev);
drivers/net/atl1c/atl1c_main.c +4 -2
@@ -66,6 +66,8 @@ static void atl1c_set_aspm(struct atl1c_static void atl1c_setup_mac_ctrl (struct atl1c_adapter *adapter);static void atl1c_clean_rx_irq (struct atl1c_adapter *adapter,u8 que,int *work_done,int work_to_do); +static int atl1c_up (struct atl1c_adapter *adapter); +static void atl1c_down (struct atl1c_adapter *adapter);static const u16 atl1c_pay_load_size[] = {128 ,256 ,512 ,1024 ,2048 ,4096 ,
@@ -2309,7 +2311,7 @@ static int atl1c_request_irq(struct atl1return err; } -int atl1c_up (struct atl1c_adapter *adapter) +static int atl1c_up (struct atl1c_adapter *adapter) {struct net_device *netdev = adapter->netdev;int num;
@@ -2351,7 +2353,7 @@ err_alloc_rx:return err; } -void atl1c_down (struct atl1c_adapter *adapter) +static void atl1c_down (struct atl1c_adapter *adapter) {struct net_device *netdev = adapter->netdev;
PATCH 5/12 atlx: make local functions/data static
In reply to Stephen Hemminger--- drivers/net/atlx/atl1.c | 12 +++++++----- drivers/net/atlx/atl1.h | 9 +++------ drivers/net/atlx/atlx.c | 4 ++++ 3 files changed, 14 insertions(+), 11 deletions(-)
drivers/net/atlx/atl1.c +7 -5
@@ -91,6 +91,8 @@ MODULE_VERSION(ATLX_DRIVER_VERSION);/* Temporary hack for merging atl1 and atl2 */ #include "atlx.c" +static const struct ethtool_ops atl1_ethtool_ops; +/* * This is the only thing that needs to be changed to adjust the * maximum number of ports that the driver can manage.
@@ -353,7 +355,7 @@ static bool atl1_read_eeprom(struct atl1* hw - Struct containing variables accessed by shared code * reg_addr - address of the PHY register to read */ -s32 atl1_read_phy_reg (struct atl1_hw *hw,u16 reg_addr,u16 *phy_data) +static s32 atl1_read_phy_reg (struct atl1_hw *hw,u16 reg_addr,u16 *phy_data) {u32 val;int i;
@@ -553,7 +555,7 @@ static s32 atl1_read_mac_addr(struct atl* 1. calcu 32bit CRC for multicast address * 2. reverse crc with MSB to LSB */ -u32 atl1_hash_mc_addr (struct atl1_hw *hw,u8 *mc_addr) +static u32 atl1_hash_mc_addr (struct atl1_hw *hw,u8 *mc_addr) {u32 crc32, value =0 ;int i;
@@ -570,7 +572,7 @@ u32 atl1_hash_mc_addr(struct atl1_hw *hw* hw - Struct containing variables accessed by shared code * hash_value - Multicast address hash value */ -void atl1_hash_set (struct atl1_hw *hw,u32 hash_value) +static void atl1_hash_set (struct atl1_hw *hw,u32 hash_value) {u32 hash_bit, hash_reg;u32 mta;
@@ -914,7 +916,7 @@ static s32 atl1_get_speed_and_duplex(strreturn 0 ; } -void atl1_set_mac_addr (struct atl1_hw *hw) +static void atl1_set_mac_addr (struct atl1_hw *hw) {u32 value;/*
@@ -3658,7 +3660,7 @@ static int atl1_nway_reset(struct net_dereturn 0 ; } -const struct ethtool_ops atl1_ethtool_ops = { +static const struct ethtool_ops atl1_ethtool_ops = { .get_settings = atl1_get_settings, .set_settings = atl1_set_settings, .get_drvinfo = atl1_get_drvinfo,
drivers/net/atlx/atl1.h +3 -6
@@ -56,16 +56,13 @@ struct atl1_adapter;struct atl1_hw ;/* function prototypes needed by multiple files */ -u32 atl1_hash_mc_addr (struct atl1_hw *hw,u8 *mc_addr); -void atl1_hash_set (struct atl1_hw *hw,u32 hash_value); -s32 atl1_read_phy_reg (struct atl1_hw *hw,u16 reg_addr,u16 *phy_data); -void atl1_set_mac_addr (struct atl1_hw *hw); +static u32 atl1_hash_mc_addr (struct atl1_hw *hw,u8 *mc_addr); +static void atl1_hash_set (struct atl1_hw *hw,u32 hash_value); +static void atl1_set_mac_addr (struct atl1_hw *hw);static int atl1_mii_ioctl (struct net_device *netdev,struct ifreq *ifr,int cmd);static u32 atl1_check_link (struct atl1_adapter *adapter); -extern const struct ethtool_ops atl1_ethtool_ops; -/* hardware definitions specific to L1 */ /* Block IDLE Status Register */
drivers/net/atlx/atlx.c +4 -0
@@ -41,6 +41,10 @@#include "atlx.h" +static s32 atlx_read_phy_reg (struct atl1_hw *hw,u16 reg_addr,u16 *phy_data); +static u32 atlx_hash_mc_addr (struct atl1_hw *hw,u8 *mc_addr); +static void atlx_set_mac_addr (struct atl1_hw *hw); +static struct atlx_spi_flash_dev flash_table[] = {/* MFR_NAME WRSR READ PRGM WREN WRDI RDSR RDID SEC_ERS CHIP_ERS */ {"Atmel" ,0x00 ,0x03 ,0x02 ,0x06 ,0x04 ,0x05 ,0x15 ,0x52 ,0x62 },
PATCH 6/12 ipconfig: make local variables/function static
In reply to Stephen Hemmingernet/ipv4/ipconfig.c +9 -9
@@ -112,12 +112,12 @@* variables using firmware environment vars. If this is set, it will * ignore such firmware variables. */ -int ic_set_manually__initdata =0 ;/* IPconfig parameters set manually */ +static int ic_set_manually__initdata =0 ;/* IPconfig parameters set manually */ static int ic_enable__initdata =0 ;/* IP config enabled? */ /* Protocol choice */ -int ic_proto_enabled __initdata = 0 +static int ic_proto_enabled __initdata = 0 #ifdef IPCONFIG_BOOTP |IC_BOOTP #endif
@@ -131,16 +131,16 @@ int ic_proto_enabled __initdata = 0static int ic_host_name_set__initdata =0 ;/* Host name set by us? */ -__be32 ic_myaddr =NONE ;/* My IP address */ +static __be32 ic_myaddr =NONE ;/* My IP address */ static __be32 ic_netmask =NONE ;/* Netmask for local subnet */ -__be32 ic_gateway =NONE ;/* Gateway IP address */ +static __be32 ic_gateway =NONE ;/* Gateway IP address */ -__be32 ic_servaddr =NONE ;/* Boot server IP address */ +static __be32 ic_servaddr =NONE ;/* Boot server IP address */ -__be32 root_server_addr =NONE ;/* Address of NFS server */ -u8 root_server_path[256 ] = {0 , };/* Path to mount as root */ +static __be32 root_server_addr =NONE ;/* Address of NFS server */ +static u8 root_server_path[256 ] = {0 };/* Path to mount as root */ -u32 ic_dev_xid;/* Device under configuration */ +static u32 ic_dev_xid;/* Device under configuration */ /* vendor class identifier */ static char vendor_class_identifier[253 ]__initdata ;
@@ -1289,7 +1289,7 @@ static const struct file_operations pnp_* need to have root_server_addr set _before_ IPConfig gets called as it * can override it. */ -__be32 __init root_nfs_parse_addr (char *name) +static __be32 __init root_nfs_parse_addr (char *name) {__be32 addr;int octets =0 ;
David Miller
maintainerRe: [PATCH 06/12] ipconfig: make local variables/function static
git grep ic_set_manually -- arch/sparc
PATCH 7/12 phylib: make local function static
In reply to Stephen HemmingerSeveral functions where exported but not used directly by any current drivers.
--- Documentation/networking/phy.txt | 18 ------------------ drivers/net/phy/phy.c | 13 +++++-------- drivers/net/phy/phy_device.c | 18 +++++++++--------- include/linux/phy.h | 12 ------------ 4 files changed, 14 insertions(+), 47 deletions(-)
drivers/net/phy/phy_device.c +11 -11
@@ -57,6 +57,9 @@ extern void mdio_bus_exit(void);static LIST_HEAD (phy_fixup_list);static DEFINE_MUTEX (phy_fixup_lock); +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface); +/* * Creates a new phy_fixup and adds it to the list * @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID)
@@ -146,7 +149,8 @@ int phy_scan_fixups(struct phy_device *p }EXPORT_SYMBOL (phy_scan_fixups); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id) +static struct phy_device *phy_device_create (struct mii_bus *bus, +int addr,int phy_id) {struct phy_device *dev;
@@ -193,7 +197,6 @@ struct phy_device* phy_device_create(strreturn dev; } -EXPORT_SYMBOL (phy_device_create);/** * get_phy_id - reads the specified addr for its ID.
@@ -204,7 +207,7 @@ EXPORT_SYMBOL(phy_device_create);* Description: Reads the ID registers of the PHY at @addr on the * @bus, stores it in @phy_id and returns zero on success. */ -int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id) +static int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id) {int phy_reg;
@@ -227,7 +230,6 @@ int get_phy_id(struct mii_bus *bus, intreturn 0 ; } -EXPORT_SYMBOL (get_phy_id);/** * get_phy_device - reads the specified PHY device and returns its @phy_device struct
@@ -316,7 +318,7 @@ EXPORT_SYMBOL(phy_find_first);* If you want to monitor your own link state, don't call * this function. */ -void phy_prepare_link (struct phy_device *phydev, +static void phy_prepare_link (struct phy_device *phydev,void (*handler)(struct net_device *)) { phydev->adjust_link = handler;
@@ -435,8 +437,8 @@ int phy_init_hw(struct phy_device *phyde* the attaching device, and given a callback for link status * change. The phy_device is returned to the attaching driver. */ -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface) +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface) {struct device *d = &phydev->dev;
@@ -473,7 +475,6 @@ int phy_attach_direct(struct net_device* (dev_flags and interface) */ return phy_init_hw (phydev); } -EXPORT_SYMBOL (phy_attach_direct);/** * phy_attach - attach a network device to a particular PHY device
@@ -540,7 +541,7 @@ EXPORT_SYMBOL(phy_detach);* what is supported. Returns < 0 on error, 0 if the PHY's advertisement * hasn't changed, and > 0 if it has changed. */ -int genphy_config_advert (struct phy_device *phydev) +static int genphy_config_advert (struct phy_device *phydev) {u32 advertise;int oldadv, adv;
@@ -605,7 +606,6 @@ int genphy_config_advert(struct phy_devireturn changed; } -EXPORT_SYMBOL (genphy_config_advert);/** * genphy_setup_forced - configures/forces speed/duplex from @phydev
@@ -615,7 +615,7 @@ EXPORT_SYMBOL(genphy_config_advert);* to the values in phydev. Assumes that the values are valid. * Please see phy_sanitize_settings(). */ -int genphy_setup_forced (struct phy_device *phydev) +static int genphy_setup_forced (struct phy_device *phydev) {int err;int ctl =0 ;
include/linux/phy.h +0 -13
@@ -469,14 +469,9 @@ static inline int phy_write(struct phy_dreturn mdiobus_write (phydev->bus, phydev->addr, regnum, val); } -int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id);struct phy_device *get_phy_device (struct mii_bus *bus,int addr);int phy_device_register (struct phy_device *phy); -int phy_clear_interrupt (struct phy_device *phydev); -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts);int phy_init_hw (struct phy_device *phydev); -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface);struct phy_device *phy_attach (struct net_device *dev,const char *bus_id,u32 flags,phy_interface_t interface);struct phy_device *phy_find_first (struct mii_bus *bus);
@@ -492,17 +487,12 @@ void phy_start(struct phy_device *phydevvoid phy_stop (struct phy_device *phydev);int phy_start_aneg (struct phy_device *phydev); -void phy_sanitize_settings (struct phy_device *phydev);int phy_stop_interrupts (struct phy_device *phydev); -int phy_enable_interrupts (struct phy_device *phydev); -int phy_disable_interrupts (struct phy_device *phydev);static inline int phy_read_status (struct phy_device *phydev) {return phydev->drv->read_status (phydev); } -int genphy_config_advert (struct phy_device *phydev); -int genphy_setup_forced (struct phy_device *phydev);int genphy_restart_aneg (struct phy_device *phydev);int genphy_config_aneg (struct phy_device *phydev);int genphy_update_link (struct phy_device *phydev);
@@ -511,8 +501,6 @@ int genphy_suspend(struct phy_device *phint genphy_resume (struct phy_device *phydev);void phy_driver_unregister (struct phy_driver *drv);int phy_driver_register (struct phy_driver *new_driver); -void phy_prepare_link (struct phy_device *phydev, -void (*adjust_link)(struct net_device *));void phy_state_machine (struct work_struct *work);void phy_start_machine (struct phy_device *phydev,void (*handler)(struct net_device *));
@@ -523,7 +511,6 @@ int phy_mii_ioctl(struct phy_device *phy struct ifreq *ifr, int cmd);int phy_start_interrupts (struct phy_device *phydev);void phy_print_status (struct phy_device *phydev); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id);void phy_device_free (struct phy_device *phydev); int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
Documentation/networking/phy.txt +0 -18
@@ -177,18 +177,6 @@ Doing it all yourself A convenience function to print out the PHY status neatly. - int phy_clear_interrupt(struct phy_device *phydev); - int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); - - Clear the PHY's interrupt, and configure which ones are allowed, - respectively. Currently only supports all on, or all off. - - int phy_enable_interrupts(struct phy_device *phydev); - int phy_disable_interrupts(struct phy_device *phydev); - - Functions which enable/disable PHY interrupts, clearing them - before and after, respectively. - int phy_start_interrupts(struct phy_device *phydev); int phy_stop_interrupts(struct phy_device *phydev);
@@ -213,12 +201,6 @@ Doing it all yourself Fills the phydev structure with up-to-date information about the current settings in the PHY. - void phy_sanitize_settings(struct phy_device *phydev) - - Resolves differences between currently desired settings, and - supported settings for the given PHY device. Does not make - the changes in the hardware, though. - int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
drivers/net/phy/phy.c +5 -8
@@ -65,7 +65,7 @@ EXPORT_SYMBOL(phy_print_status);* * Returns 0 on success on < 0 on error. */ -int phy_clear_interrupt (struct phy_device *phydev) +static int phy_clear_interrupt (struct phy_device *phydev) {int err =0 ;
@@ -82,7 +82,7 @@ int phy_clear_interrupt(struct phy_devic* * Returns 0 on success on < 0 on error. */ -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) +static int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) {int err =0 ;
@@ -208,7 +208,7 @@ static inline int phy_find_valid(int idx* duplexes. Drop down by one in this order: 1000/FULL, * 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF. */ -void phy_sanitize_settings (struct phy_device *phydev) +static void phy_sanitize_settings (struct phy_device *phydev) {u32 features = phydev->supported;int idx;
@@ -223,7 +223,6 @@ void phy_sanitize_settings(struct phy_de phydev->speed = settings[idx].speed; phydev->duplex = settings[idx].duplex; } -EXPORT_SYMBOL (phy_sanitize_settings);/** * phy_ethtool_sset - generic ethtool sset function, handles all the details
@@ -532,7 +531,7 @@ static irqreturn_t phy_interrupt(int irq* phy_enable_interrupts - Enable the interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_enable_interrupts (struct phy_device *phydev) +static int phy_enable_interrupts (struct phy_device *phydev) {int err;
@@ -545,13 +544,12 @@ int phy_enable_interrupts(struct phy_devreturn err; } -EXPORT_SYMBOL (phy_enable_interrupts);/** * phy_disable_interrupts - Disable the PHY interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_disable_interrupts (struct phy_device *phydev) +static int phy_disable_interrupts (struct phy_device *phydev) {int err;
@@ -574,7 +572,6 @@ phy_err:return err; } -EXPORT_SYMBOL (phy_disable_interrupts);/** * phy_start_interrupts - request and enable interrupts for a PHY device
Re: [PATCH 07/12] phylib: make local function static
Quoted 4 lines · Stephen Hemminger
Several functions where exported but not used directly by any current drivers.
Signed-off-by Stephen Hemminger <[email protected]>
At least some of these are used in drivers/of/of_mdio.c
Quoted 267 lines
---
Documentation/networking/phy.txt | 18 ------------------ drivers/net/phy/phy.c | 13 +++++-------- drivers/net/phy/phy_device.c | 18 +++++++++--------- include/linux/phy.h | 12 ------------ 4 files changed, 14 insertions(+), 47 deletions(-)drivers/net/phy/phy_device.c +11
-11@@ -57,6 +57,9 @@ extern void mdio_bus_exit(void);static LIST_HEAD (phy_fixup_list);static DEFINE_MUTEX (phy_fixup_lock); +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface); +/* * Creates a new phy_fixup and adds it to the list * @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID) @@ -146,7 +149,8 @@ int phy_scan_fixups(struct phy_device *p }EXPORT_SYMBOL (phy_scan_fixups); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id) +static struct phy_device *phy_device_create (struct mii_bus *bus, +int addr,int phy_id) {struct phy_device *dev;@@ -193,7 +197,6 @@ struct phy_device* phy_device_create(strreturn dev; } -EXPORT_SYMBOL (phy_device_create);/** * get_phy_id - reads the specified addr for its ID. @@ -204,7 +207,7 @@ EXPORT_SYMBOL(phy_device_create);* Description: Reads the ID registers of the PHY at @addr on the * @bus, stores it in @phy_id and returns zero on success. */ -int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id) +static int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id) {int phy_reg;@@ -227,7 +230,6 @@ int get_phy_id(struct mii_bus *bus, intreturn 0 ; } -EXPORT_SYMBOL (get_phy_id);/** * get_phy_device - reads the specified PHY device and returns its @phy_device struct @@ -316,7 +318,7 @@ EXPORT_SYMBOL(phy_find_first);* If you want to monitor your own link state, don't call * this function. */ -void phy_prepare_link (struct phy_device *phydev, +static void phy_prepare_link (struct phy_device *phydev,void (*handler)(struct net_device *)) { phydev->adjust_link = handler;@@ -435,8 +437,8 @@ int phy_init_hw(struct phy_device *phyde* the attaching device, and given a callback for link status * change. The phy_device is returned to the attaching driver. */ -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface) +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface) {struct device *d = &phydev->dev;@@ -473,7 +475,6 @@ int phy_attach_direct(struct net_device* (dev_flags and interface) */ return phy_init_hw (phydev); } -EXPORT_SYMBOL (phy_attach_direct);/** * phy_attach - attach a network device to a particular PHY device @@ -540,7 +541,7 @@ EXPORT_SYMBOL(phy_detach);* what is supported. Returns < 0 on error, 0 if the PHY's advertisement * hasn't changed, and > 0 if it has changed. */ -int genphy_config_advert (struct phy_device *phydev) +static int genphy_config_advert (struct phy_device *phydev) {u32 advertise;int oldadv, adv;@@ -605,7 +606,6 @@ int genphy_config_advert(struct phy_devireturn changed; } -EXPORT_SYMBOL (genphy_config_advert);/** * genphy_setup_forced - configures/forces speed/duplex from @phydev @@ -615,7 +615,7 @@ EXPORT_SYMBOL(genphy_config_advert);* to the values in phydev. Assumes that the values are valid. * Please see phy_sanitize_settings(). */ -int genphy_setup_forced (struct phy_device *phydev) +static int genphy_setup_forced (struct phy_device *phydev) {int err;int ctl =0 ;include/linux/phy.h +0
-13@@ -469,14 +469,9 @@ static inline int phy_write(struct phy_dreturn mdiobus_write (phydev->bus, phydev->addr, regnum, val); } -int get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id);struct phy_device *get_phy_device (struct mii_bus *bus,int addr);int phy_device_register (struct phy_device *phy); -int phy_clear_interrupt (struct phy_device *phydev); -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts);int phy_init_hw (struct phy_device *phydev); -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface);struct phy_device *phy_attach (struct net_device *dev,const char *bus_id,u32 flags,phy_interface_t interface);struct phy_device *phy_find_first (struct mii_bus *bus);@@ -492,17 +487,12 @@ void phy_start(struct phy_device *phydevvoid phy_stop (struct phy_device *phydev);int phy_start_aneg (struct phy_device *phydev); -void phy_sanitize_settings (struct phy_device *phydev);int phy_stop_interrupts (struct phy_device *phydev); -int phy_enable_interrupts (struct phy_device *phydev); -int phy_disable_interrupts (struct phy_device *phydev);static inline int phy_read_status (struct phy_device *phydev) {return phydev->drv->read_status (phydev); } -int genphy_config_advert (struct phy_device *phydev); -int genphy_setup_forced (struct phy_device *phydev);int genphy_restart_aneg (struct phy_device *phydev);int genphy_config_aneg (struct phy_device *phydev);int genphy_update_link (struct phy_device *phydev);@@ -511,8 +501,6 @@ int genphy_suspend(struct phy_device *phint genphy_resume (struct phy_device *phydev);void phy_driver_unregister (struct phy_driver *drv);int phy_driver_register (struct phy_driver *new_driver); -void phy_prepare_link (struct phy_device *phydev, -void (*adjust_link)(struct net_device *));void phy_state_machine (struct work_struct *work);void phy_start_machine (struct phy_device *phydev,void (*handler)(struct net_device *));@@ -523,7 +511,6 @@ int phy_mii_ioctl(struct phy_device *phy struct ifreq *ifr, int cmd);int phy_start_interrupts (struct phy_device *phydev);void phy_print_status (struct phy_device *phydev); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id);void phy_device_free (struct phy_device *phydev); int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,Documentation/networking/phy.txt +0
-18@@ -177,18 +177,6 @@ Doing it all yourself A convenience function to print out the PHY status neatly. - int phy_clear_interrupt(struct phy_device *phydev); - int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); - - Clear the PHY's interrupt, and configure which ones are allowed, - respectively. Currently only supports all on, or all off. - - int phy_enable_interrupts(struct phy_device *phydev); - int phy_disable_interrupts(struct phy_device *phydev); - - Functions which enable/disable PHY interrupts, clearing them - before and after, respectively. - int phy_start_interrupts(struct phy_device *phydev); int phy_stop_interrupts(struct phy_device *phydev);@@ -213,12 +201,6 @@ Doing it all yourself Fills the phydev structure with up-to-date information about the current settings in the PHY. - void phy_sanitize_settings(struct phy_device *phydev) - - Resolves differences between currently desired settings, and - supported settings for the given PHY device. Does not make - the changes in the hardware, though. - int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);drivers/net/phy/phy.c +5
-8@@ -65,7 +65,7 @@ EXPORT_SYMBOL(phy_print_status);* * Returns 0 on success on < 0 on error. */ -int phy_clear_interrupt (struct phy_device *phydev) +static int phy_clear_interrupt (struct phy_device *phydev) {int err =0 ;@@ -82,7 +82,7 @@ int phy_clear_interrupt(struct phy_devic* * Returns 0 on success on < 0 on error. */ -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) +static int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) {int err =0 ;@@ -208,7 +208,7 @@ static inline int phy_find_valid(int idx* duplexes. Drop down by one in this order: 1000/FULL, * 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF. */ -void phy_sanitize_settings (struct phy_device *phydev) +static void phy_sanitize_settings (struct phy_device *phydev) {u32 features = phydev->supported;int idx;@@ -223,7 +223,6 @@ void phy_sanitize_settings(struct phy_de phydev->speed = settings[idx].speed; phydev->duplex = settings[idx].duplex; } -EXPORT_SYMBOL (phy_sanitize_settings);/** * phy_ethtool_sset - generic ethtool sset function, handles all the details @@ -532,7 +531,7 @@ static irqreturn_t phy_interrupt(int irq* phy_enable_interrupts - Enable the interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_enable_interrupts (struct phy_device *phydev) +static int phy_enable_interrupts (struct phy_device *phydev) {int err;@@ -545,13 +544,12 @@ int phy_enable_interrupts(struct phy_devreturn err; } -EXPORT_SYMBOL (phy_enable_interrupts);/** * phy_disable_interrupts - Disable the PHY interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_disable_interrupts (struct phy_device *phydev) +static int phy_disable_interrupts (struct phy_device *phydev) {int err;@@ -574,7 +572,6 @@ phy_err:return err; } -EXPORT_SYMBOL (phy_disable_interrupts);/** * phy_start_interrupts - request and enable interrupts for a PHY device
Re: [PATCH 07/12] phylib: make local function static
The following functions are not used directly by any drivers:
phy_attach_direct
phy_device_create
phy_prepare_link
genphy_config_advert
genphy_setup_forced
phy_config_interrupt
phy_clear_interrypt
phy_sanitize_settings
phy_enable_interrupts
phy_disable_interrupts
---
Revised to keep get_phy_id which is used in one place in OF.
Documentation/networking/phy.txt | 18 ------------------ drivers/net/phy/phy.c | 13 +++++-------- drivers/net/phy/phy_device.c | 19 ++++++++++--------- include/linux/phy.h | 12 ------------ 4 files changed, 15 insertions(+), 47 deletions(-)
drivers/net/phy/phy_device.c +10 -9
@@ -57,6 +57,9 @@ extern void mdio_bus_exit(void);static LIST_HEAD (phy_fixup_list);static DEFINE_MUTEX (phy_fixup_lock); +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface); +/* * Creates a new phy_fixup and adds it to the list * @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID)
@@ -146,7 +149,8 @@ int phy_scan_fixups(struct phy_device *p }EXPORT_SYMBOL (phy_scan_fixups); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id) +static struct phy_device *phy_device_create (struct mii_bus *bus, +int addr,int phy_id) {struct phy_device *dev;
@@ -193,7 +197,6 @@ struct phy_device* phy_device_create(strreturn dev; } -EXPORT_SYMBOL (phy_device_create);/** * get_phy_id - reads the specified addr for its ID.
@@ -316,7 +319,7 @@ EXPORT_SYMBOL(phy_find_first);* If you want to monitor your own link state, don't call * this function. */ -void phy_prepare_link (struct phy_device *phydev, +static void phy_prepare_link (struct phy_device *phydev,void (*handler)(struct net_device *)) { phydev->adjust_link = handler;
@@ -435,8 +438,8 @@ int phy_init_hw(struct phy_device *phyde* the attaching device, and given a callback for link status * change. The phy_device is returned to the attaching driver. */ -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface) +static int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, +u32 flags,phy_interface_t interface) {struct device *d = &phydev->dev;
@@ -473,7 +476,6 @@ int phy_attach_direct(struct net_device* (dev_flags and interface) */ return phy_init_hw (phydev); } -EXPORT_SYMBOL (phy_attach_direct);/** * phy_attach - attach a network device to a particular PHY device
@@ -540,7 +542,7 @@ EXPORT_SYMBOL(phy_detach);* what is supported. Returns < 0 on error, 0 if the PHY's advertisement * hasn't changed, and > 0 if it has changed. */ -int genphy_config_advert (struct phy_device *phydev) +static int genphy_config_advert (struct phy_device *phydev) {u32 advertise;int oldadv, adv;
@@ -605,7 +607,6 @@ int genphy_config_advert(struct phy_devireturn changed; } -EXPORT_SYMBOL (genphy_config_advert);/** * genphy_setup_forced - configures/forces speed/duplex from @phydev
@@ -615,7 +616,7 @@ EXPORT_SYMBOL(genphy_config_advert);* to the values in phydev. Assumes that the values are valid. * Please see phy_sanitize_settings(). */ -int genphy_setup_forced (struct phy_device *phydev) +static int genphy_setup_forced (struct phy_device *phydev) {int err;int ctl =0 ;
include/linux/phy.h +0 -12
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_dint get_phy_id (struct mii_bus *bus,int addr,u32 *phy_id);struct phy_device *get_phy_device (struct mii_bus *bus,int addr);int phy_device_register (struct phy_device *phy); -int phy_clear_interrupt (struct phy_device *phydev); -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts);int phy_init_hw (struct phy_device *phydev); -int phy_attach_direct (struct net_device *dev,struct phy_device *phydev, -u32 flags,phy_interface_t interface);struct phy_device *phy_attach (struct net_device *dev,const char *bus_id,u32 flags,phy_interface_t interface);struct phy_device *phy_find_first (struct mii_bus *bus);
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydevvoid phy_stop (struct phy_device *phydev);int phy_start_aneg (struct phy_device *phydev); -void phy_sanitize_settings (struct phy_device *phydev);int phy_stop_interrupts (struct phy_device *phydev); -int phy_enable_interrupts (struct phy_device *phydev); -int phy_disable_interrupts (struct phy_device *phydev);static inline int phy_read_status (struct phy_device *phydev) {return phydev->drv->read_status (phydev); } -int genphy_config_advert (struct phy_device *phydev); -int genphy_setup_forced (struct phy_device *phydev);int genphy_restart_aneg (struct phy_device *phydev);int genphy_config_aneg (struct phy_device *phydev);int genphy_update_link (struct phy_device *phydev);
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phint genphy_resume (struct phy_device *phydev);void phy_driver_unregister (struct phy_driver *drv);int phy_driver_register (struct phy_driver *new_driver); -void phy_prepare_link (struct phy_device *phydev, -void (*adjust_link)(struct net_device *));void phy_state_machine (struct work_struct *work);void phy_start_machine (struct phy_device *phydev,void (*handler)(struct net_device *));
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phy struct ifreq *ifr, int cmd);int phy_start_interrupts (struct phy_device *phydev);void phy_print_status (struct phy_device *phydev); -struct phy_device *phy_device_create (struct mii_bus *bus,int addr,int phy_id);void phy_device_free (struct phy_device *phydev); int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
Documentation/networking/phy.txt +0 -18
@@ -177,18 +177,6 @@ Doing it all yourself A convenience function to print out the PHY status neatly. - int phy_clear_interrupt(struct phy_device *phydev); - int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); - - Clear the PHY's interrupt, and configure which ones are allowed, - respectively. Currently only supports all on, or all off. - - int phy_enable_interrupts(struct phy_device *phydev); - int phy_disable_interrupts(struct phy_device *phydev); - - Functions which enable/disable PHY interrupts, clearing them - before and after, respectively. - int phy_start_interrupts(struct phy_device *phydev); int phy_stop_interrupts(struct phy_device *phydev);
@@ -213,12 +201,6 @@ Doing it all yourself Fills the phydev structure with up-to-date information about the current settings in the PHY. - void phy_sanitize_settings(struct phy_device *phydev) - - Resolves differences between currently desired settings, and - supported settings for the given PHY device. Does not make - the changes in the hardware, though. - int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
drivers/net/phy/phy.c +5 -8
@@ -65,7 +65,7 @@ EXPORT_SYMBOL(phy_print_status);* * Returns 0 on success on < 0 on error. */ -int phy_clear_interrupt (struct phy_device *phydev) +static int phy_clear_interrupt (struct phy_device *phydev) {int err =0 ;
@@ -82,7 +82,7 @@ int phy_clear_interrupt(struct phy_devic* * Returns 0 on success on < 0 on error. */ -int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) +static int phy_config_interrupt (struct phy_device *phydev,u32 interrupts) {int err =0 ;
@@ -208,7 +208,7 @@ static inline int phy_find_valid(int idx* duplexes. Drop down by one in this order: 1000/FULL, * 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF. */ -void phy_sanitize_settings (struct phy_device *phydev) +static void phy_sanitize_settings (struct phy_device *phydev) {u32 features = phydev->supported;int idx;
@@ -223,7 +223,6 @@ void phy_sanitize_settings(struct phy_de phydev->speed = settings[idx].speed; phydev->duplex = settings[idx].duplex; } -EXPORT_SYMBOL (phy_sanitize_settings);/** * phy_ethtool_sset - generic ethtool sset function, handles all the details
@@ -532,7 +531,7 @@ static irqreturn_t phy_interrupt(int irq* phy_enable_interrupts - Enable the interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_enable_interrupts (struct phy_device *phydev) +static int phy_enable_interrupts (struct phy_device *phydev) {int err;
@@ -545,13 +544,12 @@ int phy_enable_interrupts(struct phy_devreturn err; } -EXPORT_SYMBOL (phy_enable_interrupts);/** * phy_disable_interrupts - Disable the PHY interrupts from the PHY side * @phydev: target phy_device struct */ -int phy_disable_interrupts (struct phy_device *phydev) +static int phy_disable_interrupts (struct phy_device *phydev) {int err;
@@ -574,7 +572,6 @@ phy_err:return err; } -EXPORT_SYMBOL (phy_disable_interrupts);/** * phy_start_interrupts - request and enable interrupts for a PHY device
PATCH 8/12 vxge: make functions local and remove dead code
In reply to Stephen HemmingerUse results of make namespacecheck to make functions local and remove code that is not used.
Also rename initialize_ethtool_ops to vxge_initialize_ethtool_ops.
Compile tested only.
--- drivers/net/vxge/vxge-config.c | 332 +++++++++++++++++++++++++++++----------- drivers/net/vxge/vxge-config.h | 227 --------------------------- drivers/net/vxge/vxge-ethtool.c | 2 drivers/net/vxge/vxge-main.c | 64 ++++--- drivers/net/vxge/vxge-main.h | 59 ------- drivers/net/vxge/vxge-traffic.c | 101 +----------- drivers/net/vxge/vxge-traffic.h | 134 ---------------- 7 files changed, 304 insertions(+), 615 deletions(-)
drivers/net/vxge/vxge-config.c +247 -85
@@ -20,6 +20,179 @@#include "vxge-traffic.h" #include "vxge-config.h" +static enum vxge_hw_status +__vxge_hw_fifo_create ( +struct __vxge_hw_vpath_handle *vpath_handle, +struct vxge_hw_fifo_attr *attr); + +static enum vxge_hw_status +__vxge_hw_fifo_abort ( +struct __vxge_hw_fifo *fifoh); + +static enum vxge_hw_status +__vxge_hw_fifo_reset ( +struct __vxge_hw_fifo *ringh); + +static enum vxge_hw_status +__vxge_hw_fifo_delete ( +struct __vxge_hw_vpath_handle *vpath_handle); + +static struct __vxge_hw_blockpool_entry * +__vxge_hw_blockpool_block_allocate (struct __vxge_hw_device *hldev, +u32 size); + +static void +__vxge_hw_blockpool_block_free (struct __vxge_hw_device *hldev, +struct __vxge_hw_blockpool_entry *entry); + +static void vxge_hw_blockpool_block_add (struct __vxge_hw_device *devh, +void *block_addr, +u32 length, +struct pci_dev *dma_h, +struct pci_dev *acc_handle); + +static enum vxge_hw_status +__vxge_hw_blockpool_create (struct __vxge_hw_device *hldev, +struct __vxge_hw_blockpool *blockpool, +u32 pool_size, +u32 pool_max); + +static void +__vxge_hw_blockpool_destroy (struct __vxge_hw_blockpool *blockpool); + +static void * +__vxge_hw_blockpool_malloc (struct __vxge_hw_device *hldev, +u32 size, +struct vxge_hw_mempool_dma *dma_object); + +static void +__vxge_hw_blockpool_free (struct __vxge_hw_device *hldev, +void *memblock, +u32 size, +struct vxge_hw_mempool_dma *dma_object); + + +static struct __vxge_hw_channel * +__vxge_hw_channel_allocate (struct __vxge_hw_vpath_handle *vph, +enum __vxge_hw_channel_type type,u32 length, +u32 per_dtr_space,void *userdata); + +static void +__vxge_hw_channel_free ( +struct __vxge_hw_channel *channel); + +static enum vxge_hw_status +__vxge_hw_channel_initialize ( +struct __vxge_hw_channel *channel); + +static enum vxge_hw_status +__vxge_hw_channel_reset ( +struct __vxge_hw_channel *channel); + +static enum vxge_hw_status __vxge_hw_ring_delete (struct __vxge_hw_vpath_handle *vp); + +static enum vxge_hw_status +__vxge_hw_device_fifo_config_check (struct vxge_hw_fifo_config *fifo_config); + +static enum vxge_hw_status +__vxge_hw_device_config_check (struct vxge_hw_device_config *new_config); + +static void +__vxge_hw_device_id_get (struct __vxge_hw_device *hldev); + +static void +__vxge_hw_device_host_info_get (struct __vxge_hw_device *hldev); + +static enum vxge_hw_status +__vxge_hw_vpath_card_info_get ( +u32 vp_id, +struct vxge_hw_vpath_reg __iomem *vpath_reg, +struct vxge_hw_device_hw_info *hw_info); + +static enum vxge_hw_status +__vxge_hw_device_initialize (struct __vxge_hw_device *hldev); + +static void +__vxge_hw_device_pci_e_init (struct __vxge_hw_device *hldev); + +static enum vxge_hw_status +__vxge_hw_device_reg_addr_get (struct __vxge_hw_device *hldev); + +static enum vxge_hw_status +__vxge_hw_device_register_poll ( +void __iomem *reg, +u64 mask,u32 max_millis); + +static inline enum vxge_hw_status +__vxge_hw_pio_mem_write64 (u64 val64,void __iomem *addr, +u64 mask,u32 max_millis) +{ +__vxge_hw_pio_mem_write32_lower ((u32 )vxge_bVALn (val64,32 ,32 ), addr); +wmb (); + +__vxge_hw_pio_mem_write32_upper ((u32 )vxge_bVALn (val64,0 ,32 ), addr); +wmb (); + +return __vxge_hw_device_register_poll (addr, mask, max_millis); +} + +static struct vxge_hw_mempool * +__vxge_hw_mempool_create (struct __vxge_hw_device *devh,u32 memblock_size, +u32 item_size,u32 private_size,u32 items_initial, +u32 items_max,struct vxge_hw_mempool_cbs *mp_callback, +void *userdata); +static void __vxge_hw_mempool_destroy (struct vxge_hw_mempool *mempool); + +static enum vxge_hw_status +__vxge_hw_vpath_stats_get (struct __vxge_hw_virtualpath *vpath, +struct vxge_hw_vpath_stats_hw_info *hw_stats); + +static enum vxge_hw_status +vxge_hw_vpath_stats_enable (struct __vxge_hw_vpath_handle *vpath_handle); + +static enum vxge_hw_status +__vxge_hw_legacy_swapper_set (struct vxge_hw_legacy_reg __iomem *legacy_reg); + +static u64 +__vxge_hw_vpath_pci_func_mode_get (u32 vp_id, +struct vxge_hw_vpath_reg __iomem *vpath_reg); + +static u32 +__vxge_hw_vpath_func_id_get (u32 vp_id,struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg); + +static enum vxge_hw_status +__vxge_hw_vpath_addr_get (u32 vp_id,struct vxge_hw_vpath_reg __iomem *vpath_reg, +u8 (macaddr )[ETH_ALEN ],u8 (macaddr_mask )[ETH_ALEN ]); + +static enum vxge_hw_status +__vxge_hw_vpath_reset_check (struct __vxge_hw_virtualpath *vpath); + + +static enum vxge_hw_status +__vxge_hw_vpath_sw_reset (struct __vxge_hw_device *devh,u32 vp_id); + +static enum vxge_hw_status +__vxge_hw_vpath_fw_ver_get (u32 vp_id,struct vxge_hw_vpath_reg __iomem *vpath_reg, +struct vxge_hw_device_hw_info *hw_info); + +static enum vxge_hw_status +__vxge_hw_vpath_mac_configure (struct __vxge_hw_device *devh,u32 vp_id); + +static void +__vxge_hw_vp_terminate (struct __vxge_hw_device *devh,u32 vp_id); + +static enum vxge_hw_status +__vxge_hw_vpath_stats_access (struct __vxge_hw_virtualpath *vpath, +u32 operation,u32 offset,u64 *stat); + +static enum vxge_hw_status +__vxge_hw_vpath_xmac_tx_stats_get (struct __vxge_hw_virtualpath *vpath, +struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats); + +static enum vxge_hw_status +__vxge_hw_vpath_xmac_rx_stats_get (struct __vxge_hw_virtualpath *vpath, +struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats); +/* * __vxge_hw_channel_allocate - Allocate memory for channel * This function allocates required memory for the channel and various arrays
@@ -190,7 +363,7 @@ __vxge_hw_device_pci_e_init(struct __vxg* Will poll certain register for specified amount of time. * Will poll until masked bit is not cleared. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_device_register_poll (void __iomem *reg,u64 mask,u32 max_millis) {u64 val64;
@@ -221,7 +394,7 @@ __vxge_hw_device_register_poll(void __io* in progress * This routine checks the vpath reset in progress register is turned zero */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_device_vpath_reset_in_prog_check (u64 __iomem *vpath_rst_in_prog) {enum vxge_hw_status status;
@@ -236,7 +409,7 @@ __vxge_hw_device_vpath_reset_in_prog_che* This routine sets the swapper and reads the toc pointer and returns the * memory mapped address of the toc */ -struct vxge_hw_toc_reg __iomem * +static struct vxge_hw_toc_reg __iomem *__vxge_hw_device_toc_get (void __iomem *bar0) {u64 val64;
@@ -779,7 +952,7 @@ exit:* vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port * Get the Statistics on aggregate port */ -enum vxge_hw_status +static enum vxge_hw_status vxge_hw_device_xmac_aggr_stats_get (struct __vxge_hw_device *hldev,u32 port,struct vxge_hw_xmac_aggr_stats *aggr_stats) {
@@ -814,7 +987,7 @@ exit:* vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port * Get the Statistics on port */ -enum vxge_hw_status +static enum vxge_hw_status vxge_hw_device_xmac_port_stats_get (struct __vxge_hw_device *hldev,u32 port,struct vxge_hw_xmac_port_stats *port_stats) {
@@ -952,20 +1125,6 @@ u32 vxge_hw_device_trace_level_get(strucreturn 0 ;#endif } -/* -* vxge_hw_device_debug_mask_get - Get the debug mask -* This routine returns the current debug mask set -*/ -u32 vxge_hw_device_debug_mask_get (struct __vxge_hw_device *hldev) -{ -#if defined(VXGE_DEBUG_TRACE_MASK ) || defined(VXGE_DEBUG_ERR_MASK ) -if (hldev ==NULL ) -return 0 ; -return hldev->debug_module_mask; -#else -return 0 ; -#endif -}/* * vxge_hw_getpause_data -Pause frame frame generation and reception.
@@ -1090,7 +1249,7 @@ __vxge_hw_ring_block_next_pointer_set(u8* first block * Returns the dma address of the first RxD block */ -u64 __vxge_hw_ring_first_block_address_get (struct __vxge_hw_ring *ring) +static u64 __vxge_hw_ring_first_block_address_get (struct __vxge_hw_ring *ring) {struct vxge_hw_mempool_dma *dma_object;
@@ -1252,7 +1411,7 @@ exit:* This function creates Ring and initializes it. * */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_ring_create (struct __vxge_hw_vpath_handle *vp,struct vxge_hw_ring_attr *attr) {
@@ -1363,7 +1522,7 @@ exit:* __vxge_hw_ring_abort - Returns the RxD * This function terminates the RxDs of ring */ -enum vxge_hw_status __vxge_hw_ring_abort (struct __vxge_hw_ring *ring) +static enum vxge_hw_status __vxge_hw_ring_abort (struct __vxge_hw_ring *ring) {void *rxdh;struct __vxge_hw_channel *channel;
@@ -1392,7 +1551,7 @@ enum vxge_hw_status __vxge_hw_ring_abort* __vxge_hw_ring_reset - Resets the ring * This function resets the ring during vpath reset operation */ -enum vxge_hw_status __vxge_hw_ring_reset (struct __vxge_hw_ring *ring) +static enum vxge_hw_status __vxge_hw_ring_reset (struct __vxge_hw_ring *ring) {enum vxge_hw_status status =VXGE_HW_OK ;struct __vxge_hw_channel *channel;
@@ -1419,7 +1578,7 @@ exit:* __vxge_hw_ring_delete - Removes the ring * This function freeup the memory pool and removes the ring */ -enum vxge_hw_status __vxge_hw_ring_delete (struct __vxge_hw_vpath_handle *vp) +static enum vxge_hw_status __vxge_hw_ring_delete (struct __vxge_hw_vpath_handle *vp) {struct __vxge_hw_ring *ring = vp->vpath->ringh;
@@ -1438,7 +1597,7 @@ enum vxge_hw_status __vxge_hw_ring_delet* __vxge_hw_mempool_grow * Will resize mempool up to %num_allocate value. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_mempool_grow (struct vxge_hw_mempool *mempool,u32 num_allocate,u32 *num_allocated) {
@@ -1527,7 +1686,7 @@ exit:* with size enough to hold %items_initial number of items. Memory is * DMA-able but client must map/unmap before interoperating with the device. */ -struct vxge_hw_mempool * +static struct vxge_hw_mempool * __vxge_hw_mempool_create( struct __vxge_hw_device *devh, u32 memblock_size,
@@ -1644,7 +1803,7 @@ exit:/* * vxge_hw_mempool_destroy */ -void __vxge_hw_mempool_destroy (struct vxge_hw_mempool *mempool) +static void __vxge_hw_mempool_destroy (struct vxge_hw_mempool *mempool) {u32 i, j;struct __vxge_hw_device *devh = mempool->devh;
@@ -1700,7 +1859,7 @@ __vxge_hw_device_fifo_config_check(struc* __vxge_hw_device_vpath_config_check - Check vpath configuration. * Check the vpath configuration */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_device_vpath_config_check (struct vxge_hw_vp_config *vp_config) {enum vxge_hw_status status;
@@ -1922,7 +2081,7 @@ vxge_hw_device_config_default_get(struct* _hw_legacy_swapper_set - Set the swapper bits for the legacy secion. * Set the swapper bits appropriately for the lagacy section. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_legacy_swapper_set (struct vxge_hw_legacy_reg __iomem *legacy_reg) {u64 val64;
@@ -1977,7 +2136,7 @@ __vxge_hw_legacy_swapper_set(struct vxge* __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath. * Set the swapper bits appropriately for the vpath. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_swapper_set (struct vxge_hw_vpath_reg __iomem *vpath_reg) {#ifndef __BIG_ENDIAN
@@ -1996,7 +2155,7 @@ __vxge_hw_vpath_swapper_set(struct vxge_* __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc. * Set the swapper bits appropriately for the vpath. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_kdfc_swapper_set (struct vxge_hw_legacy_reg __iomem *legacy_reg,struct vxge_hw_vpath_reg __iomem *vpath_reg)
@@ -2021,28 +2180,6 @@ __vxge_hw_kdfc_swapper_set( }/* -* vxge_hw_mgmt_device_config - Retrieve device configuration. -* Get device configuration. Permits to retrieve at run-time configuration -* values that were used to initialize and configure the device. -*/ -enum vxge_hw_status -vxge_hw_mgmt_device_config (struct __vxge_hw_device *hldev, -struct vxge_hw_device_config *dev_config,int size) -{ - -if ((hldev ==NULL ) || (hldev->magic !=VXGE_HW_DEVICE_MAGIC )) -return VXGE_HW_ERR_INVALID_DEVICE ; - -if (size !=sizeof (struct vxge_hw_device_config )) -return VXGE_HW_ERR_VERSION_CONFLICT ; - -memcpy (dev_config, &hldev->config, -sizeof (struct vxge_hw_device_config )); - -return VXGE_HW_OK ; -} - -/* * vxge_hw_mgmt_reg_read - Read Titan register. */ enum vxge_hw_status
@@ -2438,7 +2575,7 @@ exit:* __vxge_hw_fifo_abort - Returns the TxD * This function terminates the TxDs of fifo */ -enum vxge_hw_status __vxge_hw_fifo_abort (struct __vxge_hw_fifo *fifo) +static enum vxge_hw_status __vxge_hw_fifo_abort (struct __vxge_hw_fifo *fifo) {void *txdlh;
@@ -2466,7 +2603,7 @@ enum vxge_hw_status __vxge_hw_fifo_abort* __vxge_hw_fifo_reset - Resets the fifo * This function resets the fifo during vpath reset operation */ -enum vxge_hw_status __vxge_hw_fifo_reset (struct __vxge_hw_fifo *fifo) +static enum vxge_hw_status __vxge_hw_fifo_reset (struct __vxge_hw_fifo *fifo) {enum vxge_hw_status status =VXGE_HW_OK ;
@@ -2501,7 +2638,7 @@ enum vxge_hw_status __vxge_hw_fifo_delet* in pci config space. * Read from the vpath pci config space. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_pci_read (struct __vxge_hw_virtualpath *vpath,u32 phy_func_0,u32 offset,u32 *val) {
@@ -2542,7 +2679,7 @@ exit:* __vxge_hw_vpath_func_id_get - Get the function id of the vpath. * Returns the function number of the vpath. */ -u32 +static u32 __vxge_hw_vpath_func_id_get (u32 vp_id,struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg) {
@@ -2573,7 +2710,7 @@ __vxge_hw_read_rts_ds(struct vxge_hw_vpa* __vxge_hw_vpath_card_info_get - Get the serial numbers, * part number and product description. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_card_info_get( u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
@@ -2695,7 +2832,7 @@ __vxge_hw_vpath_card_info_get(* __vxge_hw_vpath_fw_ver_get - Get the fw version * Returns FW Version */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_fw_ver_get( u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
@@ -2789,7 +2926,7 @@ exit:* __vxge_hw_vpath_pci_func_mode_get - Get the pci mode * Returns pci function mode */ -u64 +static u64 __vxge_hw_vpath_pci_func_mode_get (u32 vp_id,struct vxge_hw_vpath_reg __iomem *vpath_reg)
@@ -2995,7 +3132,7 @@ exit:* __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath * from MAC address table. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_addr_get (u32 vp_id,struct vxge_hw_vpath_reg __iomem *vpath_reg,u8 (macaddr )[ETH_ALEN ],u8 (macaddr_mask )[ETH_ALEN ])
@@ -3347,7 +3484,7 @@ __vxge_hw_vpath_mgmt_read(* This routine checks the vpath_rst_in_prog register to see if * adapter completed the reset process for the vpath */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_reset_check (struct __vxge_hw_virtualpath *vpath) {enum vxge_hw_status status;
@@ -3365,7 +3502,7 @@ __vxge_hw_vpath_reset_check(struct __vxg* __vxge_hw_vpath_reset * This routine resets the vpath on the device */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_reset (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3383,7 +3520,7 @@ __vxge_hw_vpath_reset(struct __vxge_hw_d* __vxge_hw_vpath_sw_reset * This routine resets the vpath structures */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_sw_reset (struct __vxge_hw_device *hldev,u32 vp_id) {enum vxge_hw_status status =VXGE_HW_OK ;
@@ -3408,7 +3545,7 @@ exit:* This routine configures the prc registers of virtual path using the config * passed */ -void +static void __vxge_hw_vpath_prc_configure (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3480,7 +3617,7 @@ __vxge_hw_vpath_prc_configure(struct __v* This routine configures the kdfc registers of virtual path using the * config passed */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_kdfc_configure (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3553,7 +3690,7 @@ exit:* __vxge_hw_vpath_mac_configure * This routine configures the mac of virtual path using the config passed */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_mac_configure (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3621,7 +3758,7 @@ __vxge_hw_vpath_mac_configure(struct __v* This routine configures the tim registers of virtual path using the config * passed */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_tim_configure (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3897,7 +4034,7 @@ vxge_hw_vpath_tti_ci_set(struct __vxge_h* This routine is the final phase of init which initializes the * registers of the vpath using the configuration passed. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_initialize (struct __vxge_hw_device *hldev,u32 vp_id) {u64 val64;
@@ -3966,7 +4103,7 @@ exit:* This routine is the initial phase of init which resets the vpath and * initializes the software support structures. */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vp_initialize (struct __vxge_hw_device *hldev,u32 vp_id,struct vxge_hw_vp_config *config) {
@@ -4022,7 +4159,7 @@ exit:* __vxge_hw_vp_terminate - Terminate Virtual Path structure * This routine closes all channels it opened and freeup memory */ -void +static void __vxge_hw_vp_terminate (struct __vxge_hw_device *hldev,u32 vp_id) {struct __vxge_hw_virtualpath *vpath;
@@ -4384,7 +4521,7 @@ vxge_hw_vpath_enable(struct __vxge_hw_vp* Enable the DMA vpath statistics. The function is to be called to re-enable * the adapter to update stats into the host memory */ -enum vxge_hw_status +static enum vxge_hw_status vxge_hw_vpath_stats_enable (struct __vxge_hw_vpath_handle *vp) {enum vxge_hw_status status =VXGE_HW_OK ;
@@ -4409,7 +4546,7 @@ exit:* __vxge_hw_vpath_stats_access - Get the statistics from the given location * and offset and perform an operation */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_stats_access (struct __vxge_hw_virtualpath *vpath,u32 operation,u32 offset,u64 *stat) {
@@ -4445,7 +4582,7 @@ vpath_stats_access_exit:/* * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_xmac_tx_stats_get (struct __vxge_hw_virtualpath *vpath,struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats)
@@ -4478,9 +4615,9 @@ exit:/* * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath */ -enum vxge_hw_status +static enum vxge_hw_status __vxge_hw_vpath_xmac_rx_stats_get (struct __vxge_hw_virtualpath *vpath, -struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats) +struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats) {u64 *val64;enum vxge_hw_status status =VXGE_HW_OK ;
@@ -4509,9 +4646,9 @@ exit:/* * __vxge_hw_vpath_stats_get - Get the vpath hw statistics. */ -enum vxge_hw_status __vxge_hw_vpath_stats_get ( -struct __vxge_hw_virtualpath *vpath, -struct vxge_hw_vpath_stats_hw_info *hw_stats) +static enum vxge_hw_status +__vxge_hw_vpath_stats_get (struct __vxge_hw_virtualpath *vpath, +struct vxge_hw_vpath_stats_hw_info *hw_stats) {u64 val64;enum vxge_hw_status status =VXGE_HW_OK ;
@@ -4643,6 +4780,32 @@ exit:return status; } + +static void vxge_os_dma_malloc_async (struct pci_dev *pdev,void *devh, +unsigned long size) +{ +gfp_t flags; +void *vaddr; + +if (in_interrupt ()) + flags =GFP_ATOMIC |GFP_DMA ; +else + flags =GFP_KERNEL |GFP_DMA ; + + vaddr =kmalloc ((size), flags); + +vxge_hw_blockpool_block_add (devh, vaddr, size, pdev, pdev); +} + +static void vxge_os_dma_free (struct pci_dev *pdev,const void *vaddr, +struct pci_dev **p_dma_acch) +{ +unsigned long misaligned = *(unsigned long *)p_dma_acch; +u8 *tmp = (u8 *)vaddr; + tmp -= misaligned; +kfree ((void *)tmp); +} +/* * __vxge_hw_blockpool_create - Create block pool */
@@ -4845,12 +5008,11 @@ void __vxge_hw_blockpool_blocks_remove(s* vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async * Adds a block to block pool */ -void vxge_hw_blockpool_block_add ( -struct __vxge_hw_device *devh, -void *block_addr, -u32 length, -struct pci_dev *dma_h, -struct pci_dev *acc_handle) +static void vxge_hw_blockpool_block_add (struct __vxge_hw_device *devh, +void *block_addr, +u32 length, +struct pci_dev *dma_h, +struct pci_dev *acc_handle) {struct __vxge_hw_blockpool *blockpool;struct __vxge_hw_blockpool_entry *entry =NULL ;
drivers/net/vxge/vxge-config.h +1 -226
293 lines not on this page · raw message
drivers/net/vxge/vxge-main.c +38 -26
208 lines not on this page · raw message
drivers/net/vxge/vxge-main.h +1 -58
65 lines not on this page · raw message
drivers/net/vxge/vxge-traffic.c +16 -85
161 lines not on this page · raw message
drivers/net/vxge/vxge-traffic.h +0 -134
191 lines not on this page · raw message
drivers/net/vxge/vxge-ethtool.c +1 -1
@@ -1142,7 +1142,7 @@ static const struct ethtool_ops vxge_eth .get_ethtool_stats = vxge_get_ethtool_stats, }; -void initialize_ethtool_ops (struct net_device *ndev) +void vxge_initialize_ethtool_ops (struct net_device *ndev) {SET_ETHTOOL_OPS (ndev, &vxge_ethtool_ops); }
PATCH 9/12 qlge: make local functions static
In reply to Stephen Hemminger--- drivers/net/qlge/qlge.h | 2 -- drivers/net/qlge/qlge_main.c | 7 +++++-- drivers/net/qlge/qlge_mpi.c | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-)
drivers/net/qlge/qlge.h +0 -2
@@ -2226,7 +2226,6 @@ int ql_dump_risc_ram_area(struct ql_adapint ql_core_dump (struct ql_adapter *qdev,struct ql_mpi_coredump *mpi_coredump);int ql_mb_about_fw (struct ql_adapter *qdev); -int ql_wol (struct ql_adapter *qdev);int ql_mb_wol_set_magic (struct ql_adapter *qdev,u32 enable_wol);int ql_mb_wol_mode (struct ql_adapter *qdev,u32 wol);int ql_mb_set_led_cfg (struct ql_adapter *qdev,u32 led_config);
@@ -2243,7 +2242,6 @@ netdev_tx_t ql_lb_send(struct sk_buff *svoid ql_check_lb_frame (struct ql_adapter *,struct sk_buff *);int ql_own_firmware (struct ql_adapter *qdev);int ql_clean_lb_rx_ring (struct rx_ring *rx_ring,int budget); -void qlge_set_multicast_list (struct net_device *ndev);#if 1 #define QL_ALL_DUMP
drivers/net/qlge/qlge_main.c +5 -2
@@ -94,6 +94,9 @@ static DEFINE_PCI_DEVICE_TABLE(qlge_pci_MODULE_DEVICE_TABLE (pci, qlge_pci_tbl); +static int ql_wol (struct ql_adapter *qdev); +static void qlge_set_multicast_list (struct net_device *ndev); +/* This hardware semaphore causes exclusive access to * resources shared between the NIC driver, MPI firmware, * FCOE firmware and the FC driver.
@@ -3842,7 +3845,7 @@ static void ql_display_dev_info(struct n "MAC address %pM\n", ndev->dev_addr); } -int ql_wol (struct ql_adapter *qdev) +static int ql_wol (struct ql_adapter *qdev) {int status =0 ;u32 wol =MB_WOL_DISABLE ;
@@ -4242,7 +4245,7 @@ static struct net_device_stats *qlge_getreturn &ndev->stats; } -void qlge_set_multicast_list (struct net_device *ndev) +static void qlge_set_multicast_list (struct net_device *ndev) {struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv (ndev);struct netdev_hw_addr *ha;
drivers/net/qlge/qlge_mpi.c +3 -3
@@ -87,7 +87,7 @@ exit:return status; } -int ql_soft_reset_mpi_risc (struct ql_adapter *qdev) +static int ql_soft_reset_mpi_risc (struct ql_adapter *qdev) {int status; status =ql_write_mpi_reg (qdev,0x00001010 ,1 );
@@ -681,7 +681,7 @@ int ql_mb_get_fw_state(struct ql_adapter/* Send and ACK mailbox command to the firmware to * let it continue with the change. */ -int ql_mb_idc_ack (struct ql_adapter *qdev) +static int ql_mb_idc_ack (struct ql_adapter *qdev) {struct mbox_params mbc;struct mbox_params *mbcp = &mbc;
@@ -744,7 +744,7 @@ int ql_mb_set_port_cfg(struct ql_adapterreturn status; } -int ql_mb_dump_ram (struct ql_adapter *qdev,u64 req_dma,u32 addr, +static int ql_mb_dump_ram (struct ql_adapter *qdev,u64 req_dma,u32 addr,u32 size) {int status =0 ;
PATCH 10/12 qlge: disable unsed dump code
In reply to Stephen HemmingerThe driver has lots of unused code to dump data structures to console. Use existing simple way to remove the code with ifdef.
--- drivers/net/qlge/qlge.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/qlge/qlge.h +4 -6
@@ -2243,14 +2243,12 @@ void ql_check_lb_frame(struct ql_adapterint ql_own_firmware (struct ql_adapter *qdev);int ql_clean_lb_rx_ring (struct rx_ring *rx_ring,int budget); -#if 1 -#define QL_ALL_DUMP -#define QL_REG_DUMP -#define QL_DEV_DUMP -#define QL_CB_DUMP +/* #define QL_ALL_DUMP */ +/* #define QL_REG_DUMP */ +/* #define QL_DEV_DUMP */ +/* #define QL_CB_DUMP */ /* #define QL_IB_DUMP */ /* #define QL_OB_DUMP */ -#endif #ifdef QL_REG_DUMP extern void ql_dump_xgmac_control_regs (struct ql_adapter *qdev);
PATCH 11/12 bnx2x: make local function static and remove dead code
In reply to Stephen HemmingerMake many functions that are only used in one file static. Remove dead code for override_led_value.
--- drivers/net/bnx2x/bnx2x.h | 5 - drivers/net/bnx2x/bnx2x_cmn.c | 3 drivers/net/bnx2x/bnx2x_cmn.h | 55 -------------- drivers/net/bnx2x/bnx2x_init_ops.h | 34 +++++---- drivers/net/bnx2x/bnx2x_link.c | 137 ++----------------------------------- drivers/net/bnx2x/bnx2x_link.h | 15 ---- drivers/net/bnx2x/bnx2x_main.c | 55 ++++++++------ 7 files changed, 62 insertions(+), 242 deletions(-)
drivers/net/bnx2x/bnx2x_cmn.c +2 -1
@@ -25,6 +25,7 @@#include "bnx2x_init.h" +static int bnx2x_setup_irqs (struct bnx2x *bp);/* free skb in the packet ring at pos idx * return idx of last bd freed
@@ -2187,7 +2188,7 @@ int bnx2x_change_mac_addr(struct net_dev } -int bnx2x_setup_irqs (struct bnx2x *bp) +static int bnx2x_setup_irqs (struct bnx2x *bp) {int rc =0 ;if (bp->flags &USING_MSIX_FLAG ) {
drivers/net/bnx2x/bnx2x_cmn.h +0 -55
85 lines not on this page · raw message
drivers/net/bnx2x/bnx2x_link.c +10 -127
167 lines not on this page · raw message
drivers/net/bnx2x/bnx2x_link.h +0 -15
@@ -279,12 +279,6 @@ u8 bnx2x_phy_read(struct link_params *pau8 bnx2x_phy_write (struct link_params *params,u8 phy_addr,u8 devad,u16 reg,u16 val); - -u8 bnx2x_cl45_read (struct bnx2x *bp,struct bnx2x_phy *phy, -u8 devad,u16 reg,u16 *ret_val); - -u8 bnx2x_cl45_write (struct bnx2x *bp,struct bnx2x_phy *phy, -u8 devad,u16 reg,u16 val);/* Reads the link_status from the shmem, and update the link vars accordingly */ void bnx2x_link_status_update(struct link_params *input,
@@ -304,8 +298,6 @@ u8 bnx2x_set_led(struct link_params *par#define LED_MODE_OPER 2#define LED_MODE_FRONT_PANEL_OFF 3 -u8 bnx2x_override_led_value (struct bnx2x *bp,u8 port,u32 led_idx,u32 value); -/* bnx2x_handle_module_detect_int should be called upon module detection interrupt */ void bnx2x_handle_module_detect_int (struct link_params *params);
@@ -325,19 +317,12 @@ void bnx2x_ext_phy_hw_reset(struct bnx2x/* Reset the external of SFX7101 */ void bnx2x_sfx7101_sp_sw_reset (struct bnx2x *bp,struct bnx2x_phy *phy); -u8 bnx2x_read_sfp_module_eeprom (struct bnx2x_phy *phy, -struct link_params *params,u16 addr, -u8 byte_cnt,u8 *o_buf); -void bnx2x_hw_reset_phy (struct link_params *params);/* Checks if HW lock is required for this phy/board type */ u8 bnx2x_hw_lock_required (struct bnx2x *bp,u32 shmem_base,u32 shmem2_base); -/* Returns the aggregative supported attributes of the phys on board */ -u32 bnx2x_supported_attr (struct link_params *params,u8 phy_idx); -/* Check swap bit and adjust PHY order */ u32 bnx2x_phy_selection (struct link_params *params);
drivers/net/bnx2x/bnx2x_main.c +31 -24
163 lines not on this page · raw message
drivers/net/bnx2x/bnx2x.h +0 -5
@@ -1288,15 +1288,11 @@ struct bnx2x_func_init_params {#define WAIT_RAMROD_POLL 0x01#define WAIT_RAMROD_COMMON 0x02 -int bnx2x_wait_ramrod (struct bnx2x *bp,int state,int idx, -int *state_p,int flags);/* dmae */ void bnx2x_read_dmae (struct bnx2x *bp,u32 src_addr,u32 len32);void bnx2x_write_dmae (struct bnx2x *bp,dma_addr_t dma_addr,u32 dst_addr,u32 len32); -void bnx2x_write_dmae_phys_len (struct bnx2x *bp,dma_addr_t phys_addr, -u32 addr,u32 len);void bnx2x_post_dmae (struct bnx2x *bp,struct dmae_command *dmae,int idx);u32 bnx2x_dmae_opcode_add_comp (u32 opcode,u8 comp_type);u32 bnx2x_dmae_opcode_clr_src_reset (u32 opcode);
@@ -1307,7 +1303,6 @@ int bnx2x_get_gpio(struct bnx2x *bp, intint bnx2x_set_gpio (struct bnx2x *bp,int gpio_num,u32 mode,u8 port);int bnx2x_set_gpio_int (struct bnx2x *bp,int gpio_num,u32 mode,u8 port);u32 bnx2x_fw_command (struct bnx2x *bp,u32 command,u32 param); -void bnx2x_reg_wr_ind (struct bnx2x *bp,u32 addr,u32 val);void bnx2x_calc_fc_adv (struct bnx2x *bp); int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,
drivers/net/bnx2x/bnx2x_init_ops.h +19 -15
@@ -16,7 +16,9 @@#define BNX2X_INIT_OPS_H static int bnx2x_gunzip (struct bnx2x *bp,const u8 *zbuf,int len); - +static void bnx2x_reg_wr_ind (struct bnx2x *bp,u32 addr,u32 val); +static void bnx2x_write_dmae_phys_len (struct bnx2x *bp,dma_addr_t phys_addr, +u32 addr,u32 len);static void bnx2x_init_str_wr (struct bnx2x *bp,u32 addr,const u32 *data,u32 len)
@@ -589,7 +591,7 @@ static int bnx2x_ilt_client_mem_op(strucreturn rc; } -int bnx2x_ilt_mem_op (struct bnx2x *bp,u8 memop) +static int bnx2x_ilt_mem_op (struct bnx2x *bp,u8 memop) {int rc =bnx2x_ilt_client_mem_op (bp,ILT_CLIENT_CDU , memop);if (!rc)
@@ -635,7 +637,7 @@ static void bnx2x_ilt_line_init_op(struc } } -void bnx2x_ilt_boundry_init_op (struct bnx2x *bp, +static void bnx2x_ilt_boundry_init_op (struct bnx2x *bp,struct ilt_client_info *ilt_cli,u32 ilt_start,u8 initop) {
@@ -688,8 +690,10 @@ void bnx2x_ilt_boundry_init_op(struct bn } } -void bnx2x_ilt_client_init_op_ilt (struct bnx2x *bp,struct bnx2x_ilt *ilt, -struct ilt_client_info *ilt_cli,u8 initop) +static void bnx2x_ilt_client_init_op_ilt (struct bnx2x *bp, +struct bnx2x_ilt *ilt, +struct ilt_client_info *ilt_cli, +u8 initop) {int i;
@@ -703,8 +707,8 @@ void bnx2x_ilt_client_init_op_ilt(structbnx2x_ilt_boundry_init_op (bp, ilt_cli, ilt->start_line, initop); } -void bnx2x_ilt_client_init_op (struct bnx2x *bp, -struct ilt_client_info *ilt_cli,u8 initop) +static void bnx2x_ilt_client_init_op (struct bnx2x *bp, +struct ilt_client_info *ilt_cli,u8 initop) {struct bnx2x_ilt *ilt =BP_ILT (bp);
@@ -720,7 +724,7 @@ static void bnx2x_ilt_client_id_init_op(bnx2x_ilt_client_init_op (bp, ilt_cli, initop); } -void bnx2x_ilt_init_op (struct bnx2x *bp,u8 initop) +static void bnx2x_ilt_init_op (struct bnx2x *bp,u8 initop) {bnx2x_ilt_client_id_init_op (bp,ILT_CLIENT_CDU , initop);bnx2x_ilt_client_id_init_op (bp,ILT_CLIENT_QM , initop);
@@ -752,7 +756,7 @@ static void bnx2x_ilt_init_client_psz(st* called during init common stage, ilt clients should be initialized * prioir to calling this function */ -void bnx2x_ilt_init_page_size (struct bnx2x *bp,u8 initop) +static void bnx2x_ilt_init_page_size (struct bnx2x *bp,u8 initop) {bnx2x_ilt_init_client_psz (bp,ILT_CLIENT_CDU ,PXP2_REG_RQ_CDU_P_SIZE , initop);
@@ -772,8 +776,8 @@ void bnx2x_ilt_init_page_size(struct bnx#define QM_INIT (cid_cnt) (cid_cnt > QM_INIT_MIN_CID_COUNT)/* called during init port stage */ -void bnx2x_qm_init_cid_count (struct bnx2x *bp,int qm_cid_count, -u8 initop) +static void bnx2x_qm_init_cid_count (struct bnx2x *bp,int qm_cid_count, +u8 initop) {int port =BP_PORT (bp);
@@ -814,8 +818,8 @@ static void bnx2x_qm_set_ptr_table(struc }/* called during init common stage */ -void bnx2x_qm_init_ptr_table (struct bnx2x *bp,int qm_cid_count, -u8 initop) +static void bnx2x_qm_init_ptr_table (struct bnx2x *bp,int qm_cid_count, +u8 initop) {if (!QM_INIT (qm_cid_count))return ;
@@ -836,8 +840,8 @@ void bnx2x_qm_init_ptr_table(struct bnx2****************************************************************************/ /* called during init func stage */ -void bnx2x_src_init_t2 (struct bnx2x *bp,struct src_ent *t2, -dma_addr_t t2_mapping,int src_cid_count) +static void bnx2x_src_init_t2 (struct bnx2x *bp,struct src_ent *t2, +dma_addr_t t2_mapping,int src_cid_count) {int i;int port =BP_PORT (bp);
PATCH 12/12 e1000: make e1000_reinit_safe local
In reply to Stephen Hemmingerdrivers/net/e1000/e1000_main.c +1 -1
@@ -521,7 +521,7 @@ void e1000_down(struct e1000_adapter *ade1000_clean_all_rx_rings (adapter); } -void e1000_reinit_safe (struct e1000_adapter *adapter) +static void e1000_reinit_safe (struct e1000_adapter *adapter) {while (test_and_set_bit (__E1000_RESETTING, &adapter->flags))msleep (1 );
Re: [PATCH 12/12] e1000: make e1000_reinit_safe local
Quoted 7 lines · Stephen Hemminger
Signed-off-by Stephen Hemminger <[email protected]>
drivers/net/e1000/e1000_main.c void e1000_down(struct e1000_adapter *ad · line 527
Quoted 8 lines
drivers/net/e1000/e1000_main.c +1
-1@@ -521,7 +521,7 @@ void e1000_down(struct e1000_adapter *ade1000_clean_all_rx_rings (adapter); } -void e1000_reinit_safe (struct e1000_adapter *adapter) +static void e1000_reinit_safe (struct e1000_adapter *adapter) {while (test_and_set_bit (__E1000_RESETTING, &adapter->flags))msleep (1 );
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Thu, 21 Oct 2010 10:50:45 -0700
Quoted 2 lines
These are the last of the cleanups to networking for 2.6.37 based on "make namespacecheck" reports.
All applied except the ipconfig patch that breaks the sparc build.
Thanks.