* [PATCH net-next 2/5] net: Fix (nearly-)kernel-doc comments for various functions
From: Ben Hutchings @ 2012-07-06 22:45 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1341614561.2923.15.camel@bwh-desktop.uk.solarflarecom.com>
Fix incorrect start markers, wrapped summary lines, missing section
breaks, incorrect separators, and some name mismatches.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
net/9p/trans_virtio.c | 2 +-
net/appletalk/ddp.c | 8 ++--
net/batman-adv/bridge_loop_avoidance.c | 51 +++++++++++++++++++++----------
net/batman-adv/hash.h | 3 +-
net/batman-adv/main.h | 3 +-
net/batman-adv/types.h | 3 +-
net/core/dev.c | 8 +++--
net/core/rtnetlink.c | 2 +-
net/core/skbuff.c | 5 ++-
net/dccp/ackvec.h | 7 +++-
net/dccp/ccid.c | 1 +
net/dccp/ccids/ccid3.c | 8 ++++-
net/dccp/ccids/lib/loss_interval.c | 1 +
net/dccp/ccids/lib/packet_history.c | 3 +-
net/dccp/ccids/lib/tfrc_equation.c | 2 +
net/dccp/dccp.h | 1 +
net/dccp/feat.c | 10 ++++++
net/dccp/input.c | 1 +
net/dccp/options.c | 1 +
net/dccp/output.c | 1 +
net/ethernet/eth.c | 3 ++
net/ipv4/ipmr.c | 4 +-
net/ipv6/ip6_tunnel.c | 2 +-
net/llc/af_llc.c | 2 +-
net/llc/llc_station.c | 16 +++++-----
net/mac80211/mesh.c | 2 +-
net/mac80211/mesh_hwmp.c | 7 +++-
net/mac80211/mesh_pathtbl.c | 4 +-
net/mac80211/mesh_plink.c | 5 ++-
net/mac80211/rx.c | 2 +-
net/netfilter/xt_TPROXY.c | 4 +-
net/netlink/genetlink.c | 2 +-
net/rds/page.c | 9 +++--
net/rxrpc/ar-output.c | 2 +-
net/sunrpc/backchannel_rqst.c | 9 +++--
net/sunrpc/clnt.c | 2 +-
net/sunrpc/xdr.c | 12 ++++---
net/sunrpc/xprt.c | 2 +-
net/tipc/bcast.c | 10 +++---
net/tipc/bearer.c | 7 ++--
net/tipc/bearer.h | 2 +-
net/tipc/link.c | 22 +++++++-------
net/tipc/name_table.c | 10 +++---
net/tipc/port.c | 2 +-
net/tipc/port.h | 1 +
net/x25/x25_route.c | 2 +-
46 files changed, 163 insertions(+), 103 deletions(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 2a16765..35b8911 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -212,7 +212,7 @@ static int p9_virtio_cancel(struct p9_client *client, struct p9_req_t *req)
* this takes a list of pages.
* @sg: scatter/gather list to pack into
* @start: which segment of the sg_list to start at
- * @**pdata: a list of pages to add into sg.
+ * @pdata: a list of pages to add into sg.
* @nr_pages: number of pages to pack into the scatter/gather list
* @data: data to pack into scatter/gather list
* @count: amount of data to pack into the scatter/gather list
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 8685296..3347529 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -129,8 +129,8 @@ found:
/**
* atalk_find_or_insert_socket - Try to find a socket matching ADDR
- * @sk - socket to insert in the list if it is not there already
- * @sat - address to search for
+ * @sk: socket to insert in the list if it is not there already
+ * @sat: address to search for
*
* Try to find a socket matching ADDR in the socket list, if found then return
* it. If not, insert SK into the socket list.
@@ -1066,8 +1066,8 @@ static int atalk_release(struct socket *sock)
/**
* atalk_pick_and_bind_port - Pick a source port when one is not given
- * @sk - socket to insert into the tables
- * @sat - address to search for
+ * @sk: socket to insert into the tables
+ * @sat: address to search for
*
* Pick a source port when one is not given. If we can find a suitable free
* one, we insert the socket into the tables using it.
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 49e10d9..3483e40 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -162,12 +162,13 @@ static struct batadv_claim *batadv_claim_hash_find(struct batadv_priv *bat_priv,
return claim_tmp;
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_backbone_hash_find - looks for a claim in the hash
+ * @bat_priv: the bat priv with all the soft interface information
* @addr: the address of the originator
* @vid: the VLAN ID
*
- * looks for a claim in the hash, and returns it if found
- * or NULL otherwise.
+ * Returns claim if found or NULL otherwise.
*/
static struct batadv_backbone_gw *
batadv_backbone_hash_find(struct batadv_priv *bat_priv,
@@ -242,12 +243,12 @@ batadv_bla_del_backbone_claims(struct batadv_backbone_gw *backbone_gw)
backbone_gw->crc = BATADV_BLA_CRC_INIT;
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_send_claim - sends a claim frame according to the provided info
+ * @bat_priv: the bat priv with all the soft interface information
* @orig: the mac address to be announced within the claim
* @vid: the VLAN ID
* @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...)
- *
- * sends a claim frame according to the provided info.
*/
static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
short vid, int claimtype)
@@ -348,7 +349,9 @@ out:
batadv_hardif_free_ref(primary_if);
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_get_backbone_gw
+ * @bat_priv: the bat priv with all the soft interface information
* @orig: the mac address of the originator
* @vid: the VLAN ID
*
@@ -520,12 +523,12 @@ static void batadv_bla_send_announce(struct batadv_priv *bat_priv,
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_add_claim - Adds a claim in the claim hash
+ * @bat_priv: the bat priv with all the soft interface information
* @mac: the mac address of the claim
* @vid: the VLAN ID of the frame
* @backbone_gw: the backbone gateway which claims it
- *
- * Adds a claim in the claim hash.
*/
static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
const uint8_t *mac, const short vid,
@@ -743,7 +746,9 @@ static int batadv_handle_claim(struct batadv_priv *bat_priv,
return 1;
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_check_claim_group
+ * @bat_priv: the bat priv with all the soft interface information
* @hw_src: the Hardware source in the ARP Header
* @hw_dst: the Hardware destination in the ARP Header
* @ethhdr: pointer to the Ethernet header of the claim frame
@@ -975,7 +980,9 @@ purge_now:
}
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_purge_claims
+ * @bat_priv: the bat priv with all the soft interface information
* @primary_if: the selected primary interface, may be NULL if now is set
* @now: whether the whole hash shall be wiped now
*
@@ -1023,7 +1030,9 @@ purge_now:
}
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_update_orig_address
+ * @bat_priv: the bat priv with all the soft interface information
* @primary_if: the new selected primary_if
* @oldif: the old primary interface, may be NULL
*
@@ -1193,7 +1202,9 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
return 0;
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_check_bcast_duplist
+ * @bat_priv: the bat priv with all the soft interface information
* @bcast_packet: originator mac address
* @hdr_size: maximum length of the frame
*
@@ -1297,7 +1308,9 @@ int batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, uint8_t *orig)
}
-/* @skb: the frame to be checked
+/**
+ * batadv_bla_is_backbone_gw
+ * @skb: the frame to be checked
* @orig_node: the orig_node of the frame
* @hdr_size: maximum length of the frame
*
@@ -1363,7 +1376,9 @@ void batadv_bla_free(struct batadv_priv *bat_priv)
batadv_hardif_free_ref(primary_if);
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_rx
+ * @bat_priv: the bat priv with all the soft interface information
* @skb: the frame to be checked
* @vid: the VLAN ID of the frame
*
@@ -1450,7 +1465,9 @@ out:
return ret;
}
-/* @bat_priv: the bat priv with all the soft interface information
+/**
+ * batadv_bla_tx
+ * @bat_priv: the bat priv with all the soft interface information
* @skb: the frame to be checked
* @vid: the VLAN ID of the frame
*
diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h
index 83990e3..977de9c 100644
--- a/net/batman-adv/hash.h
+++ b/net/batman-adv/hash.h
@@ -81,7 +81,8 @@ static inline void batadv_hash_delete(struct batadv_hashtable *hash,
batadv_hash_destroy(hash);
}
-/* hash_add - adds data to the hashtable
+/**
+ * batadv_hash_add - adds data to the hashtable
* @hash: storage hash table
* @compare: callback to determine if 2 hash elements are identical
* @choose: callback calculating the hash index
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index b8d4ac1..5d8fa07 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -216,7 +216,8 @@ static inline int batadv_compare_eth(const void *data1, const void *data2)
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
}
-/* has_timed_out - compares current time (jiffies) and timestamp + timeout
+/**
+ * has_timed_out - compares current time (jiffies) and timestamp + timeout
* @timestamp: base value to compare with (in jiffies)
* @timeout: added to base value before comparing (in milliseconds)
*
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 2141c13..12635fd 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -44,7 +44,8 @@ struct batadv_hard_iface {
struct rcu_head rcu;
};
-/* batadv_orig_node - structure for orig_list maintaining nodes of mesh
+/**
+ * struct batadv_orig_node - structure for orig_list maintaining nodes of mesh
* @primary_addr: hosts primary interface address
* @last_seen: when last packet from this node was received
* @bcast_seqno_reset: time when the broadcast seqno window was reset
diff --git a/net/core/dev.c b/net/core/dev.c
index 9c21548..5ab6f4b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1691,7 +1691,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
rcu_read_unlock();
}
-/* netif_setup_tc - Handle tc mappings on real_num_tx_queues change
+/**
+ * netif_setup_tc - Handle tc mappings on real_num_tx_queues change
* @dev: Network device
* @txq: number of queues available
*
@@ -1793,7 +1794,8 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
EXPORT_SYMBOL(netif_set_real_num_rx_queues);
#endif
-/* netif_get_num_default_rss_queues - default number of RSS queues
+/**
+ * netif_get_num_default_rss_queues - default number of RSS queues
*
* This routine should set an upper limit on the number of RSS queues
* used by default by multiqueue devices.
@@ -5670,7 +5672,7 @@ int netdev_refcnt_read(const struct net_device *dev)
}
EXPORT_SYMBOL(netdev_refcnt_read);
-/*
+/**
* netdev_wait_allrefs - wait until all references are gone.
*
* This is called when unregistering network devices.
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2b325c3..b79a7fe 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2176,7 +2176,7 @@ skip:
}
/**
- * ndo_dflt_fdb_dump: default netdevice operation to dump an FDB table.
+ * ndo_dflt_fdb_dump - default netdevice operation to dump an FDB table.
* @nlh: netlink message header
* @dev: netdevice
*
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5a789a8..506f678 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -713,7 +713,8 @@ struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src)
}
EXPORT_SYMBOL_GPL(skb_morph);
-/* skb_copy_ubufs - copy userspace skb frags buffers to kernel
+/**
+ * skb_copy_ubufs - copy userspace skb frags buffers to kernel
* @skb: the skb to modify
* @gfp_mask: allocation priority
*
@@ -2614,7 +2615,7 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
EXPORT_SYMBOL(skb_find_text);
/**
- * skb_append_datato_frags: - append the user data to a skb
+ * skb_append_datato_frags - append the user data to a skb
* @sk: sock structure
* @skb: skb structure to be appened with user data.
* @getfrag: call back function to be used for getting the user data
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h
index e2ab062..a269aa7 100644
--- a/net/dccp/ackvec.h
+++ b/net/dccp/ackvec.h
@@ -50,7 +50,8 @@ static inline u8 dccp_ackvec_state(const u8 *cell)
return *cell & ~DCCPAV_MAX_RUNLEN;
}
-/** struct dccp_ackvec - Ack Vector main data structure
+/**
+ * struct dccp_ackvec - Ack Vector main data structure
*
* This implements a fixed-size circular buffer within an array and is largely
* based on Appendix A of RFC 4340.
@@ -76,7 +77,8 @@ struct dccp_ackvec {
struct list_head av_records;
};
-/** struct dccp_ackvec_record - Records information about sent Ack Vectors
+/**
+ * struct dccp_ackvec_record - Records information about sent Ack Vectors
*
* These list entries define the additional information which the HC-Receiver
* keeps about recently-sent Ack Vectors; again refer to RFC 4340, Appendix A.
@@ -121,6 +123,7 @@ static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av)
* @len: length of @vec
* @nonce: whether @vec had an ECN nonce of 0 or 1
* @node: FIFO - arranged in descending order of ack_ackno
+ *
* This structure is used by CCIDs to access Ack Vectors in a received skb.
*/
struct dccp_ackvec_parsed {
diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c
index 48b585a..5975572 100644
--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -46,6 +46,7 @@ bool ccid_support_check(u8 const *ccid_array, u8 array_len)
* ccid_get_builtin_ccids - Populate a list of built-in CCIDs
* @ccid_array: pointer to copy into
* @array_len: value to return length into
+ *
* This function allocates memory - caller must see that it is freed after use.
*/
int ccid_get_builtin_ccids(u8 **ccid_array, u8 *array_len)
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 8c67bed..d65e987 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -113,6 +113,7 @@ static u32 ccid3_hc_tx_idle_rtt(struct ccid3_hc_tx_sock *hc, ktime_t now)
/**
* ccid3_hc_tx_update_x - Update allowed sending rate X
* @stamp: most recent time if available - can be left NULL.
+ *
* This function tracks draft rfc3448bis, check there for latest details.
*
* Note: X and X_recv are both stored in units of 64 * bytes/second, to support
@@ -161,9 +162,11 @@ static void ccid3_hc_tx_update_x(struct sock *sk, ktime_t *stamp)
}
}
-/*
- * Track the mean packet size `s' (cf. RFC 4342, 5.3 and RFC 3448, 4.1)
+/**
+ * ccid3_hc_tx_update_s - Track the mean packet size `s'
* @len: DCCP packet payload size in bytes
+ *
+ * cf. RFC 4342, 5.3 and RFC 3448, 4.1
*/
static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hc, int len)
{
@@ -270,6 +273,7 @@ out:
/**
* ccid3_hc_tx_send_packet - Delay-based dequeueing of TX packets
* @skb: next packet candidate to send on @sk
+ *
* This function uses the convention of ccid_packet_dequeue_eval() and
* returns a millisecond-delay value between 0 and t_mbi = 64000 msec.
*/
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
index 497723c..57f9fd78 100644
--- a/net/dccp/ccids/lib/loss_interval.c
+++ b/net/dccp/ccids/lib/loss_interval.c
@@ -133,6 +133,7 @@ static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur,
* @rh: Receive history containing a fresh loss event
* @calc_first_li: Caller-dependent routine to compute length of first interval
* @sk: Used by @calc_first_li in caller-specific way (subtyping)
+ *
* Updates I_mean and returns 1 if a new interval has in fact been added to @lh.
*/
int tfrc_lh_interval_add(struct tfrc_loss_hist *lh, struct tfrc_rx_hist *rh,
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c
index de8fe29..08df7a3 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -315,6 +315,7 @@ static void __three_after_loss(struct tfrc_rx_hist *h)
* @ndp: The NDP count belonging to @skb
* @calc_first_li: Caller-dependent computation of first loss interval in @lh
* @sk: Used by @calc_first_li (see tfrc_lh_interval_add)
+ *
* Chooses action according to pending loss, updates LI database when a new
* loss was detected, and does required post-processing. Returns 1 when caller
* should send feedback, 0 otherwise.
@@ -387,7 +388,7 @@ static inline struct tfrc_rx_hist_entry *
}
/**
- * tfrc_rx_hist_rtt_prev_s: previously suitable (wrt rtt_last_s) RTT-sampling entry
+ * tfrc_rx_hist_rtt_prev_s - previously suitable (wrt rtt_last_s) RTT-sampling entry
*/
static inline struct tfrc_rx_hist_entry *
tfrc_rx_hist_rtt_prev_s(const struct tfrc_rx_hist *h)
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c
index a052a43..88ef982 100644
--- a/net/dccp/ccids/lib/tfrc_equation.c
+++ b/net/dccp/ccids/lib/tfrc_equation.c
@@ -611,6 +611,7 @@ static inline u32 tfrc_binsearch(u32 fval, u8 small)
* @s: packet size in bytes
* @R: RTT scaled by 1000000 (i.e., microseconds)
* @p: loss ratio estimate scaled by 1000000
+ *
* Returns X_calc in bytes per second (not scaled).
*/
u32 tfrc_calc_x(u16 s, u32 R, u32 p)
@@ -659,6 +660,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
/**
* tfrc_calc_x_reverse_lookup - try to find p given f(p)
* @fvalue: function value to match, scaled by 1000000
+ *
* Returns closest match for p, also scaled by 1000000
*/
u32 tfrc_calc_x_reverse_lookup(u32 fvalue)
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 9040be0..708e75b 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -352,6 +352,7 @@ static inline int dccp_bad_service_code(const struct sock *sk,
* @dccpd_opt_len: total length of all options (5.8) in the packet
* @dccpd_seq: sequence number
* @dccpd_ack_seq: acknowledgment number subheader field value
+ *
* This is used for transmission as well as for reception.
*/
struct dccp_skb_cb {
diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index 78a2ad7..9733ddb 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -350,6 +350,7 @@ static int __dccp_feat_activate(struct sock *sk, const int idx,
* @feat_num: feature to activate, one of %dccp_feature_numbers
* @local: whether local (1) or remote (0) @feat_num is meant
* @fval: the value (SP or NN) to activate, or NULL to use the default value
+ *
* For general use this function is preferable over __dccp_feat_activate().
*/
static int dccp_feat_activate(struct sock *sk, u8 feat_num, bool local,
@@ -446,6 +447,7 @@ static struct dccp_feat_entry *dccp_feat_list_lookup(struct list_head *fn_list,
* @head: list to add to
* @feat: feature number
* @local: whether the local (1) or remote feature with number @feat is meant
+ *
* This is the only constructor and serves to ensure the above invariants.
*/
static struct dccp_feat_entry *
@@ -504,6 +506,7 @@ static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local,
* @feat: one of %dccp_feature_numbers
* @local: whether local (1) or remote (0) @feat_num is being confirmed
* @fval: pointer to NN/SP value to be inserted or NULL
+ *
* Returns 0 on success, a Reset code for further processing otherwise.
*/
static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local,
@@ -691,6 +694,7 @@ int dccp_feat_insert_opts(struct dccp_sock *dp, struct dccp_request_sock *dreq,
* @feat: an NN feature from %dccp_feature_numbers
* @mandatory: use Mandatory option if 1
* @nn_val: value to register (restricted to 4 bytes)
+ *
* Note that NN features are local by definition (RFC 4340, 6.3.2).
*/
static int __feat_register_nn(struct list_head *fn, u8 feat,
@@ -760,6 +764,7 @@ int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
* dccp_feat_nn_get - Query current/pending value of NN feature
* @sk: DCCP socket of an established connection
* @feat: NN feature number from %dccp_feature_numbers
+ *
* For a known NN feature, returns value currently being negotiated, or
* current (confirmed) value if no negotiation is going on.
*/
@@ -790,6 +795,7 @@ EXPORT_SYMBOL_GPL(dccp_feat_nn_get);
* @sk: DCCP socket of an established connection
* @feat: NN feature number from %dccp_feature_numbers
* @nn_val: the new value to use
+ *
* This function is used to communicate NN updates out-of-band.
*/
int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val)
@@ -930,6 +936,7 @@ static const struct ccid_dependency *dccp_feat_ccid_deps(u8 ccid, bool is_local)
* @fn: feature-negotiation list to update
* @id: CCID number to track
* @is_local: whether TX CCID (1) or RX CCID (0) is meant
+ *
* This function needs to be called after registering all other features.
*/
static int dccp_feat_propagate_ccid(struct list_head *fn, u8 id, bool is_local)
@@ -953,6 +960,7 @@ static int dccp_feat_propagate_ccid(struct list_head *fn, u8 id, bool is_local)
/**
* dccp_feat_finalise_settings - Finalise settings before starting negotiation
* @dp: client or listening socket (settings will be inherited)
+ *
* This is called after all registrations (socket initialisation, sysctls, and
* sockopt calls), and before sending the first packet containing Change options
* (ie. client-Request or server-Response), to ensure internal consistency.
@@ -1284,6 +1292,7 @@ confirmation_failed:
* @feat: NN number, one of %dccp_feature_numbers
* @val: NN value
* @len: length of @val in bytes
+ *
* This function combines the functionality of change_recv/confirm_recv, with
* the following differences (reset codes are the same):
* - cleanup after receiving the Confirm;
@@ -1379,6 +1388,7 @@ fast_path_failed:
* @feat: one of %dccp_feature_numbers
* @val: value contents of @opt
* @len: length of @val in bytes
+ *
* Returns 0 on success, a Reset code for ending the connection otherwise.
*/
int dccp_feat_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
diff --git a/net/dccp/input.c b/net/dccp/input.c
index bc93a33..14cdafa 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -710,6 +710,7 @@ EXPORT_SYMBOL_GPL(dccp_rcv_state_process);
/**
* dccp_sample_rtt - Validate and finalise computation of RTT sample
* @delta: number of microseconds between packet and acknowledgment
+ *
* The routine is kept generic to work in different contexts. It should be
* called immediately when the ACK used for the RTT sample arrives.
*/
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 68fa6b7..a58e0b6 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -527,6 +527,7 @@ int dccp_insert_option_mandatory(struct sk_buff *skb)
* @val: NN value or SP array (preferred element first) to copy
* @len: true length of @val in bytes (excluding first element repetition)
* @repeat_first: whether to copy the first element of @val twice
+ *
* The last argument is used to construct Confirm options, where the preferred
* value and the preference list appear separately (RFC 4340, 6.3.1). Preference
* lists are kept such that the preferred entry is always first, so we only need
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 7873673..d17fc90 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -214,6 +214,7 @@ void dccp_write_space(struct sock *sk)
* dccp_wait_for_ccid - Await CCID send permission
* @sk: socket to wait for
* @delay: timeout in jiffies
+ *
* This is used by CCIDs which need to delay the send time in process context.
*/
static int dccp_wait_for_ccid(struct sock *sk, unsigned long delay)
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index db6a6c1..4efad53 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -232,6 +232,7 @@ EXPORT_SYMBOL(eth_header_parse);
* @neigh: source neighbour
* @hh: destination cache entry
* @type: Ethernet type field
+ *
* Create an Ethernet header template from the neighbour.
*/
int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
@@ -274,6 +275,7 @@ EXPORT_SYMBOL(eth_header_cache_update);
* eth_mac_addr - set new Ethernet hardware address
* @dev: network device
* @p: socket address
+ *
* Change hardware address of device.
*
* This doesn't change hardware matching, so needs to be overridden
@@ -331,6 +333,7 @@ const struct header_ops eth_header_ops ____cacheline_aligned = {
/**
* ether_setup - setup Ethernet network device
* @dev: network device
+ *
* Fill in the fields of the device structure with Ethernet-generic values.
*/
void ether_setup(struct net_device *dev)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index b4ac39f..5716c6b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -524,8 +524,8 @@ failure:
}
#endif
-/*
- * Delete a VIF entry
+/**
+ * vif_delete - Delete a VIF entry
* @notify: Set to 1, if the caller is a notifier_call
*/
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 04a3cba..6af3fcf 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -252,7 +252,7 @@ static void ip6_dev_free(struct net_device *dev)
}
/**
- * ip6_tnl_create() - create a new tunnel
+ * ip6_tnl_create - create a new tunnel
* @p: tunnel parameters
* @pt: pointer to new tunnel
*
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index fe5453c..f6fe4d4 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -1024,7 +1024,7 @@ static int llc_ui_ioctl(struct socket *sock, unsigned int cmd,
* @sock: Socket to set options on.
* @level: Socket level user is requesting operations on.
* @optname: Operation name.
- * @optval User provided operation data.
+ * @optval: User provided operation data.
* @optlen: Length of optval.
*
* Set various connection specific parameters.
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
index cf4aea3..39a8d89 100644
--- a/net/llc/llc_station.c
+++ b/net/llc/llc_station.c
@@ -30,12 +30,12 @@
*
* SAP and connection resource manager, one per adapter.
*
- * @state - state of station
- * @xid_r_count - XID response PDU counter
- * @mac_sa - MAC source address
- * @sap_list - list of related SAPs
- * @ev_q - events entering state mach.
- * @mac_pdu_q - PDUs ready to send to MAC
+ * @state: state of station
+ * @xid_r_count: XID response PDU counter
+ * @mac_sa: MAC source address
+ * @sap_list: list of related SAPs
+ * @ev_q: events entering state mach.
+ * @mac_pdu_q: PDUs ready to send to MAC
*/
struct llc_station {
u8 state;
@@ -646,7 +646,7 @@ static void llc_station_service_events(void)
}
/**
- * llc_station_state_process: queue event and try to process queue.
+ * llc_station_state_process - queue event and try to process queue.
* @skb: Address of the event
*
* Queues an event (on the station event queue) for handling by the
@@ -672,7 +672,7 @@ static void llc_station_ack_tmr_cb(unsigned long timeout_data)
}
}
-/*
+/**
* llc_station_rcv - send received pdu to the station state machine
* @skb: received frame.
*
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 764593d..6fac18c 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -133,7 +133,7 @@ bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie)
}
/**
- * mesh_accept_plinks_update: update accepting_plink in local mesh beacons
+ * mesh_accept_plinks_update - update accepting_plink in local mesh beacons
*
* @sdata: mesh interface in which mesh beacons are going to be updated
*/
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index fb7b6a1..494bc39 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1054,12 +1054,15 @@ enddiscovery:
kfree(preq_node);
}
-/* mesh_nexthop_resolve - lookup next hop for given skb and start path
- * discovery if no forwarding information is found.
+/**
+ * mesh_nexthop_resolve - lookup next hop; conditionally start path discovery
*
* @skb: 802.11 frame to be sent
* @sdata: network subif the frame will be sent through
*
+ * Lookup next hop for given skb and start path discovery if no
+ * forwarding information is found.
+ *
* Returns: 0 if the next hop was found and -ENOENT if the frame was queued.
* skb is freeed here if no mpath could be allocated.
*/
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index c9ae931..075bc53 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -778,7 +778,7 @@ static void __mesh_path_del(struct mesh_table *tbl, struct mpath_node *node)
/**
* mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches
*
- * @sta - mesh peer to match
+ * @sta: mesh peer to match
*
* RCU notes: this function is called when a mesh plink transitions from
* PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that
@@ -833,7 +833,7 @@ static void table_flush_by_iface(struct mesh_table *tbl,
*
* This function deletes both mesh paths as well as mesh portal paths.
*
- * @sdata - interface data to match
+ * @sdata: interface data to match
*
*/
void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index a1dbd15..9ad74dd 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -99,7 +99,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
return sta;
}
-/*
+/**
* mesh_set_ht_prot_mode - set correct HT protection mode
*
* Section 9.23.3.5 of IEEE 80211-2012 describes the protection rules for HT
@@ -320,7 +320,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
return 0;
}
-/* mesh_peer_init - initialize new mesh peer and return resulting sta_info
+/**
+ * mesh_peer_init - initialize new mesh peer and return resulting sta_info
*
* @sdata: local meshif
* @addr: peer's address
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 839cac8..67edd69 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -94,7 +94,7 @@ ieee80211_rx_radiotap_len(struct ieee80211_local *local,
return len;
}
-/*
+/**
* ieee80211_add_rx_radiotap_header - add radiotap header
*
* add a radiotap header containing all the fields which the hardware provided.
diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c
index 146033a..d7f1953 100644
--- a/net/netfilter/xt_TPROXY.c
+++ b/net/netfilter/xt_TPROXY.c
@@ -69,7 +69,7 @@ tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr)
}
/**
- * tproxy_handle_time_wait4() - handle IPv4 TCP TIME_WAIT reopen redirections
+ * tproxy_handle_time_wait4 - handle IPv4 TCP TIME_WAIT reopen redirections
* @skb: The skb being processed.
* @laddr: IPv4 address to redirect to or zero.
* @lport: TCP port to redirect to or zero.
@@ -220,7 +220,7 @@ tproxy_laddr6(struct sk_buff *skb, const struct in6_addr *user_laddr,
}
/**
- * tproxy_handle_time_wait6() - handle IPv6 TCP TIME_WAIT reopen redirections
+ * tproxy_handle_time_wait6 - handle IPv6 TCP TIME_WAIT reopen redirections
* @skb: The skb being processed.
* @tproto: Transport protocol.
* @thoff: Transport protocol header offset.
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 32761b5..62ebe3c 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -504,7 +504,7 @@ EXPORT_SYMBOL(genl_unregister_family);
* @pid: netlink pid the message is addressed to
* @seq: sequence number (usually the one of the sender)
* @family: generic netlink family
- * @flags netlink message flags
+ * @flags: netlink message flags
* @cmd: generic netlink command
*
* Returns pointer to user specific header
diff --git a/net/rds/page.c b/net/rds/page.c
index 2499cd1..9005a2c 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -74,11 +74,12 @@ int rds_page_copy_user(struct page *page, unsigned long offset,
}
EXPORT_SYMBOL_GPL(rds_page_copy_user);
-/*
- * Message allocation uses this to build up regions of a message.
+/**
+ * rds_page_remainder_alloc - build up regions of a message.
*
- * @bytes - the number of bytes needed.
- * @gfp - the waiting behaviour of the allocation
+ * @scat: Scatter list for message
+ * @bytes: the number of bytes needed.
+ * @gfp: the waiting behaviour of the allocation
*
* @gfp is always ored with __GFP_HIGHMEM. Callers must be prepared to
* kmap the pages, etc.
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 16ae887..e1ac183 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -242,7 +242,7 @@ int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
EXPORT_SYMBOL(rxrpc_kernel_send_data);
-/*
+/**
* rxrpc_kernel_abort_call - Allow a kernel service to abort a call
* @call: The call to be aborted
* @abort_code: The abort code to stick into the ABORT packet
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 31def68..5a3d675 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -176,13 +176,14 @@ out_free:
}
EXPORT_SYMBOL_GPL(xprt_setup_backchannel);
-/*
- * Destroys the backchannel preallocated structures.
+/**
+ * xprt_destroy_backchannel - Destroys the backchannel preallocated structures.
+ * @xprt: the transport holding the preallocated strucures
+ * @max_reqs the maximum number of preallocated structures to destroy
+ *
* Since these structures may have been allocated by multiple calls
* to xprt_setup_backchannel, we only destroy up to the maximum number
* of reqs specified by the caller.
- * @xprt: the transport holding the preallocated strucures
- * @max_reqs the maximum number of preallocated structures to destroy
*/
void xprt_destroy_backchannel(struct rpc_xprt *xprt, unsigned int max_reqs)
{
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index f56f045..00eb859 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -385,7 +385,7 @@ out_no_rpciod:
return ERR_PTR(err);
}
-/*
+/**
* rpc_create - create an RPC client and transport with one call
* @args: rpc_clnt create argument structure
*
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index fddcccf..0cf1655 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -180,7 +180,9 @@ EXPORT_SYMBOL_GPL(xdr_inline_pages);
/*
* Helper routines for doing 'memmove' like operations on a struct xdr_buf
- *
+ */
+
+/**
* _shift_data_right_pages
* @pages: vector of pages containing both the source and dest memory area.
* @pgto_base: page vector address of destination
@@ -242,7 +244,7 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
} while ((len -= copy) != 0);
}
-/*
+/**
* _copy_to_pages
* @pages: array of pages
* @pgbase: page vector address of destination
@@ -286,7 +288,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len)
flush_dcache_page(*pgto);
}
-/*
+/**
* _copy_from_pages
* @p: pointer to destination
* @pages: array of pages
@@ -326,7 +328,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
}
EXPORT_SYMBOL_GPL(_copy_from_pages);
-/*
+/**
* xdr_shrink_bufhead
* @buf: xdr_buf
* @len: bytes to remove from buf->head[0]
@@ -399,7 +401,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
buf->len = buf->buflen;
}
-/*
+/**
* xdr_shrink_pagelen
* @buf: xdr_buf
* @len: bytes to remove from buf->pages
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 3c83035..a5a402a 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -531,7 +531,7 @@ void xprt_set_retrans_timeout_def(struct rpc_task *task)
}
EXPORT_SYMBOL_GPL(xprt_set_retrans_timeout_def);
-/*
+/**
* xprt_set_retrans_timeout_rtt - set a request's retransmit timeout
* @task: task whose timeout is to be set
*
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 2625f5e..d9df34f 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -162,7 +162,7 @@ static void bclink_update_last_sent(struct tipc_node *node, u32 seqno)
}
-/*
+/**
* tipc_bclink_retransmit_to - get most recent node to request retransmission
*
* Called with bc_lock locked
@@ -270,7 +270,7 @@ exit:
spin_unlock_bh(&bc_lock);
}
-/*
+/**
* tipc_bclink_update_link_state - update broadcast link state
*
* tipc_net_lock and node lock set
@@ -330,7 +330,7 @@ void tipc_bclink_update_link_state(struct tipc_node *n_ptr, u32 last_sent)
}
}
-/*
+/**
* bclink_peek_nack - monitor retransmission requests sent by other nodes
*
* Delay any upcoming NACK by this node if another node has already
@@ -381,7 +381,7 @@ exit:
return res;
}
-/*
+/**
* bclink_accept_pkt - accept an incoming, in-sequence broadcast packet
*
* Called with both sending node's lock and bc_lock taken.
@@ -406,7 +406,7 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
}
}
-/*
+/**
* tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards
*
* tipc_net_lock is read_locked, no other locks set
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index a297e3a..86b703f 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -172,8 +172,8 @@ struct sk_buff *tipc_media_get_names(void)
/**
* bearer_name_validate - validate & (optionally) deconstruct bearer name
- * @name - ptr to bearer name string
- * @name_parts - ptr to area for bearer name components (or NULL if not needed)
+ * @name: ptr to bearer name string
+ * @name_parts: ptr to area for bearer name components (or NULL if not needed)
*
* Returns 1 if bearer name is valid, otherwise 0.
*/
@@ -520,8 +520,7 @@ exit:
}
/**
- * tipc_block_bearer(): Block the bearer with the given name,
- * and reset all its links
+ * tipc_block_bearer - Block the bearer with the given name, and reset all its links
*/
int tipc_block_bearer(const char *name)
{
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index e3b2be3..4680de1 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -57,7 +57,7 @@
*/
#define TIPC_MEDIA_TYPE_ETH 1
-/*
+/**
* struct tipc_media_addr - destination address used by TIPC bearers
* @value: address info (format defined by media)
* @media_id: TIPC media type identifier
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 7a614f4..f6bf483 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -153,8 +153,8 @@ int tipc_link_is_active(struct tipc_link *l_ptr)
/**
* link_name_validate - validate & (optionally) deconstruct tipc_link name
- * @name - ptr to link name string
- * @name_parts - ptr to area for link name components (or NULL if not needed)
+ * @name: ptr to link name string
+ * @name_parts: ptr to area for link name components (or NULL if not needed)
*
* Returns 1 if link name is valid, otherwise 0.
*/
@@ -944,7 +944,7 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
return res;
}
-/*
+/**
* tipc_link_send_names - send name table entries to new neighbor
*
* Send routine for bulk delivery of name table messages when contact
@@ -1787,7 +1787,7 @@ cont:
read_unlock_bh(&tipc_net_lock);
}
-/*
+/**
* tipc_link_defer_pkt - Add out-of-sequence message to deferred reception queue
*
* Returns increase in queue length (i.e. 0 or 1)
@@ -2635,8 +2635,8 @@ void tipc_link_set_queue_limits(struct tipc_link *l_ptr, u32 window)
/**
* link_find_link - locate link by name
- * @name - ptr to link name string
- * @node - ptr to area to be filled with ptr to associated node
+ * @name: ptr to link name string
+ * @node: ptr to area to be filled with ptr to associated node
*
* Caller must hold 'tipc_net_lock' to ensure node and bearer are not deleted;
* this also prevents link deletion.
@@ -2671,8 +2671,8 @@ static struct tipc_link *link_find_link(const char *name,
/**
* link_value_is_valid -- validate proposed link tolerance/priority/window
*
- * @cmd - value type (TIPC_CMD_SET_LINK_*)
- * @new_value - the new value
+ * @cmd: value type (TIPC_CMD_SET_LINK_*)
+ * @new_value: the new value
*
* Returns 1 if value is within range, 0 if not.
*/
@@ -2693,9 +2693,9 @@ static int link_value_is_valid(u16 cmd, u32 new_value)
/**
* link_cmd_set_value - change priority/tolerance/window for link/bearer/media
- * @name - ptr to link, bearer, or media name
- * @new_value - new value of link, bearer, or media setting
- * @cmd - which link, bearer, or media attribute to set (TIPC_CMD_SET_LINK_*)
+ * @name: ptr to link, bearer, or media name
+ * @new_value: new value of link, bearer, or media setting
+ * @cmd: which link, bearer, or media attribute to set (TIPC_CMD_SET_LINK_*)
*
* Caller must hold 'tipc_net_lock' to ensure link/bearer/media is not deleted.
*
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 010f24a..13fb9d5 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -191,7 +191,7 @@ static void nameseq_delete_empty(struct name_seq *seq)
}
}
-/*
+/**
* nameseq_find_subseq - find sub-sequence (if any) matching a name instance
*
* Very time-critical, so binary searches through sub-sequence array.
@@ -435,7 +435,7 @@ found:
}
/**
- * tipc_nameseq_subscribe: attach a subscription, and issue
+ * tipc_nameseq_subscribe - attach a subscription, and issue
* the prescribed number of events if there is any sub-
* sequence overlapping with the requested sequence
*/
@@ -520,7 +520,7 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower,
return publ;
}
-/*
+/**
* tipc_nametbl_translate - perform name translation
*
* On entry, 'destnode' is the search domain used during translation.
@@ -751,7 +751,7 @@ void tipc_nametbl_unsubscribe(struct tipc_subscription *s)
/**
- * subseq_list: print specified sub-sequence contents into the given buffer
+ * subseq_list - print specified sub-sequence contents into the given buffer
*/
static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
u32 index)
@@ -787,7 +787,7 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
}
/**
- * nameseq_list: print specified name sequence contents into the given buffer
+ * nameseq_list - print specified name sequence contents into the given buffer
*/
static void nameseq_list(struct name_seq *seq, struct print_buf *buf, u32 depth,
u32 type, u32 lowbound, u32 upbound, u32 index)
diff --git a/net/tipc/port.c b/net/tipc/port.c
index a1e8289..70bf78b 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -69,7 +69,7 @@ static u32 port_peerport(struct tipc_port *p_ptr)
return msg_destport(&p_ptr->phdr);
}
-/*
+/**
* tipc_port_peer_msg - verify message was sent by connected port's peer
*
* Handles cases where the node's network address has changed from
diff --git a/net/tipc/port.h b/net/tipc/port.h
index 98cbec9..4660e30 100644
--- a/net/tipc/port.h
+++ b/net/tipc/port.h
@@ -79,6 +79,7 @@ typedef void (*tipc_continue_event) (void *usr_handle, u32 portref);
* struct user_port - TIPC user port (used with native API)
* @usr_handle: user-specified field
* @ref: object reference to associated TIPC port
+ *
* <various callback routines>
*/
struct user_port {
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c
index cf63662..277c8d2 100644
--- a/net/x25/x25_route.c
+++ b/net/x25/x25_route.c
@@ -66,7 +66,7 @@ out:
/**
* __x25_remove_route - remove route from x25_route_list
- * @rt - route to remove
+ * @rt: route to remove
*
* Remove route from x25_route_list. If it was there.
* Caller must hold x25_route_list_lock.
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 1/5] net: Properly define functions with no parameters
From: Ben Hutchings @ 2012-07-06 22:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1341614561.2923.15.camel@bwh-desktop.uk.solarflarecom.com>
Defining a function as 'T foo()' is the deprecated K&R syntax, and is not
strictly equivalent to defining it as 'T foo(void)'.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
drivers/net/cris/eth_v10.c | 2 +-
net/core/dev.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 9c755db..f0c8bd5 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1008,7 +1008,7 @@ e100_send_mdio_bit(unsigned char bit)
}
static unsigned char
-e100_receive_mdio_bit()
+e100_receive_mdio_bit(void)
{
unsigned char bit;
*R_NETWORK_MGM_CTRL = 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index 69f7a1a..9c21548 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1798,7 +1798,7 @@ EXPORT_SYMBOL(netif_set_real_num_rx_queues);
* This routine should set an upper limit on the number of RSS queues
* used by default by multiqueue devices.
*/
-int netif_get_num_default_rss_queues()
+int netif_get_num_default_rss_queues(void)
{
return min_t(int, DEFAULT_MAX_NUM_RSS_QUEUES, num_online_cpus());
}
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* [PATCH net-next 0/5] Cleanup, mostly kernel-doc
From: Ben Hutchings @ 2012-07-06 22:42 UTC (permalink / raw)
To: David Miller; +Cc: netdev
I spotted some minor errors in the RSS policy changes, and one thing led
to another and I ended up with all this:
Ben Hutchings (5):
net: Properly define functions with no parameters
net: Fix (nearly-)kernel-doc comments for various functions
net: Fix non-kernel-doc comments with kernel-doc start marker
drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various
functions
drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc
start markers
drivers/net/cris/eth_v10.c | 2 +-
drivers/net/ethernet/3com/3c501.c | 2 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 68 ++---
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 70 ++---
drivers/net/ethernet/atheros/atl1e/atl1e_param.c | 2 +-
drivers/net/ethernet/atheros/atlx/atl1.c | 41 ++--
drivers/net/ethernet/atheros/atlx/atl2.c | 56 ++---
drivers/net/ethernet/atheros/atlx/atlx.c | 10 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 9 -
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 +-
.../net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 35 ++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 4 +-
drivers/net/ethernet/broadcom/cnic.c | 2 +-
drivers/net/ethernet/brocade/bna/bfa_cee.c | 61 ++----
drivers/net/ethernet/brocade/bna/bfa_cs.h | 24 +-
drivers/net/ethernet/brocade/bna/bfa_defs.h | 34 ++--
drivers/net/ethernet/brocade/bna/bfa_defs_cna.h | 9 +-
.../net/ethernet/brocade/bna/bfa_defs_mfg_comm.h | 18 +-
drivers/net/ethernet/brocade/bna/bfa_defs_status.h | 2 +-
drivers/net/ethernet/brocade/bna/bfa_ioc.c | 267 ++++++++++----------
drivers/net/ethernet/brocade/bna/bfa_ioc.h | 24 +-
drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c | 24 +-
drivers/net/ethernet/brocade/bna/bfa_msgq.c | 4 +-
drivers/net/ethernet/brocade/bna/bfi.h | 42 ++--
drivers/net/ethernet/brocade/bna/bfi_cna.h | 20 +-
drivers/net/ethernet/brocade/bna/bfi_enet.h | 64 +++---
drivers/net/ethernet/brocade/bna/bfi_reg.h | 2 +-
drivers/net/ethernet/brocade/bna/bna.h | 22 +-
drivers/net/ethernet/brocade/bna/bna_enet.c | 6 +-
drivers/net/ethernet/brocade/bna/bna_hw_defs.h | 12 +-
drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 8 +-
drivers/net/ethernet/brocade/bna/bna_types.h | 22 +-
drivers/net/ethernet/brocade/bna/bnad.c | 8 +-
drivers/net/ethernet/brocade/bna/bnad.h | 2 +-
drivers/net/ethernet/chelsio/cxgb3/sge.c | 2 +-
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 2 +-
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +-
drivers/net/ethernet/ethoc.c | 4 +-
drivers/net/ethernet/freescale/fec.c | 4 +-
drivers/net/ethernet/ibm/ehea/ehea_qmr.c | 2 +-
drivers/net/ethernet/intel/e1000/e1000_hw.c | 8 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 8 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
drivers/net/ethernet/intel/igb/igb_main.c | 1 +
drivers/net/ethernet/intel/igbvf/netdev.c | 1 +
drivers/net/ethernet/intel/igbvf/vf.c | 5 +-
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 3 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 10 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 41 ++--
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 38 ++--
drivers/net/ethernet/intel/ixgbe/ixgbe_sysfs.c | 8 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 6 +-
drivers/net/ethernet/micrel/ksz884x.c | 2 +-
drivers/net/ethernet/neterion/s2io.c | 10 +-
drivers/net/ethernet/neterion/vxge/vxge-main.h | 2 +-
drivers/net/ethernet/nvidia/forcedeth.c | 4 +-
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_api.c | 12 +-
.../ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c | 10 +-
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_param.c | 4 +-
drivers/net/ethernet/sfc/mcdi_pcol.h | 2 +-
drivers/net/ethernet/sfc/net_driver.h | 2 +-
drivers/net/ethernet/sfc/rx.c | 1 +
drivers/net/ethernet/smsc/smc911x.c | 6 +-
drivers/net/ethernet/smsc/smc91x.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +-
drivers/net/ethernet/tehuti/tehuti.c | 177 ++++++++------
drivers/net/ethernet/ti/davinci_emac.c | 74 +++---
drivers/net/ethernet/toshiba/spider_net.c | 6 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
net/9p/trans_virtio.c | 2 +-
net/appletalk/ddp.c | 8 +-
net/batman-adv/bridge_loop_avoidance.c | 51 +++--
net/batman-adv/hash.h | 3 +-
net/batman-adv/main.h | 3 +-
net/batman-adv/types.h | 3 +-
net/ceph/pagelist.c | 6 +-
net/core/dev.c | 10 +-
net/core/rtnetlink.c | 2 +-
net/core/skbuff.c | 5 +-
net/dcb/dcbnl.c | 2 +-
net/dccp/ackvec.h | 7 +-
net/dccp/ccid.c | 1 +
net/dccp/ccids/ccid3.c | 8 +-
net/dccp/ccids/lib/loss_interval.c | 1 +
net/dccp/ccids/lib/packet_history.c | 3 +-
net/dccp/ccids/lib/tfrc_equation.c | 2 +
net/dccp/dccp.h | 1 +
net/dccp/feat.c | 10 +
net/dccp/input.c | 1 +
net/dccp/options.c | 1 +
net/dccp/output.c | 1 +
net/ethernet/eth.c | 3 +
net/ipv4/ipmr.c | 4 +-
net/ipv4/tcp.c | 2 +-
net/ipv6/ip6_tunnel.c | 2 +-
net/llc/af_llc.c | 2 +-
net/llc/llc_station.c | 16 +-
net/mac80211/mesh.c | 2 +-
net/mac80211/mesh_hwmp.c | 7 +-
net/mac80211/mesh_pathtbl.c | 4 +-
net/mac80211/mesh_plink.c | 5 +-
net/mac80211/rx.c | 2 +-
net/netfilter/xt_TPROXY.c | 4 +-
net/netlink/genetlink.c | 2 +-
net/rds/page.c | 9 +-
net/rxrpc/ar-output.c | 2 +-
net/sunrpc/backchannel_rqst.c | 9 +-
net/sunrpc/clnt.c | 2 +-
net/sunrpc/xdr.c | 12 +-
net/sunrpc/xprt.c | 2 +-
net/tipc/bcast.c | 10 +-
net/tipc/bearer.c | 7 +-
net/tipc/bearer.h | 2 +-
net/tipc/link.c | 22 +-
net/tipc/name_table.c | 10 +-
net/tipc/port.c | 2 +-
net/tipc/port.h | 1 +
net/tipc/socket.c | 2 +-
net/x25/x25_route.c | 2 +-
126 files changed, 871 insertions(+), 878 deletions(-)
--
1.7.7.6
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 4 2/4] NET ethernet introduce mac_platform helper
From: Ben Hutchings @ 2012-07-06 22:40 UTC (permalink / raw)
To: Andy Green
Cc: linux-omap, s-jan, arnd, patches, tony, netdev, linux-kernel,
rostedt, linux-arm-kernel
In-Reply-To: <20120705024446.26317.49693.stgit@build.warmcat.com>
On Thu, 2012-07-05 at 10:44 +0800, Andy Green wrote:
[...]
> To make use of this safely you also need to make sure that any drivers that
> may compete for the bus ordinal you are using (eg, mUSB and ehci in Panda
> case) are loaded in a deterministic order.
[...]
This seems very restrictive... would it be practical to also allow a
driver name as a path component?
[...]
> --- /dev/null
> +++ b/include/net/mac-platform.h
> @@ -0,0 +1,39 @@
> +/*
> + * mac-platform.h: Enforces platform-defined MAC for Async probed devices
> + */
> +
> +#ifndef __NET_MAC_PLATFORM_H__
> +#define __NET_MAC_PLATFORM_H__
> +
> +#include <linux/if_ether.h>
> +
> +/**
> + * struct mac_platform - associates asynchronously probed device path with
> + * MAC address to be assigned to the device when it
> + * is created
A kernel-doc summary is strictly limited to one line. The longer
explanation can go in a paragraph under the field descriptions.
> + * @device_path: device path name of network device
> + * @mac: MAC address to assign to network device matching device path
> + * @list: can be left uninitialized when passing from platform
> + */
> +
> +struct mac_platform {
> + char *device_path;
> + u8 mac[ETH_ALEN];
> + struct list_head list; /* unused in platform data usage */
> +};
[...]
> --- /dev/null
> +++ b/net/ethernet/mac-platform.c
[...]
> +static struct mac_platform *__mac_platform_check(struct device *dev)
> +{
> + const char *path;
> + const char *p;
> + const char *try;
> + int len;
> + struct device *devn;
> + struct mac_platform *tmp;
> + struct list_head *pos;
> +
> + list_for_each(pos, &mac_platform_list) {
> +
> + tmp = list_entry(pos, struct mac_platform, list);
> +
> + try = tmp->device_path;
> +
> + p = try + strlen(try);
> + devn = dev;
> +
> + while (devn) {
> +
> + path = dev_name(devn);
> + len = strlen(path);
> +
> + if ((p - try) < len) {
> + devn = NULL;
> + continue;
> + }
> +
> + p -= len;
[...]
There are so many blank lines here, it's hard to see much code at once.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 2/2] ksz884x: fix Endian
From: Ben Hutchings @ 2012-07-06 22:40 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev, Tristram.Ha
In-Reply-To: <1341454003-11227-1-git-send-email-roy.qing.li@gmail.com>
On Thu, 2012-07-05 at 10:06 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> ETH_P_IP is host Endian, skb->protocol is big Endian, when
> compare them, we should change skb->protocol from big endian
> to host endian, ntohs, not htons.
>
> CC: Tristram Ha <Tristram.Ha@micrel.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> drivers/net/ethernet/micrel/ksz884x.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
> index eaf9ff0..d9727f7 100644
> --- a/drivers/net/ethernet/micrel/ksz884x.c
> +++ b/drivers/net/ethernet/micrel/ksz884x.c
> @@ -4882,7 +4882,7 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
> if (left) {
> if (left < num ||
> ((CHECKSUM_PARTIAL == skb->ip_summed) &&
> - (ETH_P_IPV6 == htons(skb->protocol)))) {
> + (ETH_P_IPV6 == ntohs(skb->protocol)))) {
This should really be changed to the idiomatic 'skb->protocol ==
htons(ETH_P_IPV6)'. For the current code, the compiler will probably
generate a run-time byte-swap for little-endian systems.
Ben.
> struct sk_buff *org_skb = skb;
>
> skb = netdev_alloc_skb(dev, org_skb->len);
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 2/4] phylib: add context argument to adjust link callback
From: Ben Hutchings @ 2012-07-06 22:39 UTC (permalink / raw)
To: s-paulraj; +Cc: netdev, davem, cyril, grant.likely, linux-keystone
In-Reply-To: <1341605382-20563-1-git-send-email-s-paulraj@ti.com>
On Fri, 2012-07-06 at 16:09 -0400, s-paulraj@ti.com wrote:
> From: Sandeep Paulraj <s-paulraj@ti.com>
>
> This patch introduces a context argument for the adjust link callback. This
> context information is set at phy_connect() (and its variants), and is passed
> back into the adjust_link callbacks on link state change events.
>
> Such context information is necessary when a network device has multiple
> underlying ports. Specifically, this comes into play when the netdev is
> really one of the ports going into an on-chip switch of some sort.
[...]
I have no particular opinion on the interface change, but the tree
should be compilable after each commit. So patches 2-4 need to be
squashed together or otherwise refactored so that this is true.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] smsc95xx: support ethtool get_regs
From: Francois Romieu @ 2012-07-06 22:11 UTC (permalink / raw)
To: Émeric Vigier
Cc: Steve Glendinning, steve glendinning, netdev, Nancy Lin
In-Reply-To: <2138981415.303377.1341610005571.JavaMail.root@mail.savoirfairelinux.com>
Émeric Vigier <emeric.vigier@savoirfairelinux.com> :
[...]
> Yes, there are 16 bits wide according to smsc95xx.h.
> But other smsc drivers define 32bit wide PHY regs. I made myself believe
> that smsc would use the same PHY for each ethernet chip.
SMSC people would surely answer before I find the relevant datasheet.
Anyway the PHY registers are accessed indirectly through the MII_{ADDR, DATA}
registers and MII_DATA r/w mask is limited to the lower 16 bits.
> So would something like s/32 * sizeof(u32)/PHY_SPECIAL * sizeof(u16)/ solve the issue here?
You would have to pack data[] as well. Or use u16 *.
> Concerning the ioctl, I found ethtool much easier to use. And I believe
> smsc9514 is a very popular chipset, so this could help others debugging it.
# mii-tool -vv e1000
Using SIOCGMIIPHY=0x8947
e1000: no autonegotiation, 10baseT-HD, link ok
registers for MII PHY 0:
1140 796d 0141 0c30 0de1 0021 0004 0000
0000 0200 0000 0000 0000 0000 0000 3000
0000 0000 0000 0000 0174 0000 0000 0000
4100 0000 000d 000f 0000 0000 0000 0000
product info: vendor 00:50:43, model 3 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 10baseT-HD
It is not that bad for the first 32 PHY registers.
[...]
> Do you mean LTT? I am not familiar with it, I should have a look.
Documentation/trace/ftrace.txt
[...]
> I should change that in previous "for" loop as well I suppose?
You may.
--
Ueimor
^ permalink raw reply
* Unusual power consumption of ethernet device r8169 and backlight
From: Jerome Glisse @ 2012-07-06 21:52 UTC (permalink / raw)
To: linux-kernel, netdev, linux-pm
I am seeing somewhat very high power consumption usage of the network
device and backlight
Here is what report powertop, network can go as high as 9W
8.03 W 100.0% Device Display backlight
5.19 W 23.1 pkts/s Device Network
interface: p20p1 (r8169)
When turning off backlight , it effectively vanish and reflect in
power usage, i can't turn off the network device.
So question is this backlight consumption expected ? And am i right
assuming that the network driver is doing something horribly wrong
that the consumption is so high (i must stress that it doesn't matter
if there is network activities or not, plug or unplugged it doesn't
change).
Cheers,
Jerome Glisse
r8169 0000:01:00.0: eth0: RTL8168evl/8111evl at 0xffffc90000052000,
e8:03:9a:b4:a3:90, XID 0c900800 IRQ 45
lspci -vv -s 01:00.0
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
Subsystem: Samsung Electronics Co Ltd Device c660
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 42
Region 0: I/O ports at e000 [size=256]
Region 2: Memory at d0004000 (64-bit, prefetchable) [size=4K]
Region 4: Memory at d0000000 (64-bit, prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0300c Data: 4169
Capabilities: [70] Express (v2) Endpoint, MSI 01
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 <64us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 4096 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0
unlimited, L1 <64us
ClockPM+ Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive-
BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-,
Selectable De-emphasis: -6dB
Transmit Margin: Normal Operating Range, EnterModifiedCompliance-
ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-,
EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00000800
Capabilities: [d0] Vital Product Data
No end tag found
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF-
MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF-
MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+
MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [140 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number 01-00-00-00-68-4c-e0-00
Kernel driver in use: r8169
^ permalink raw reply
* Re: [PATCH 1/4] asix: Fix checkpatch warnings
From: Grant Grundler @ 2012-07-06 21:43 UTC (permalink / raw)
To: Eric Dumazet
Cc: Christian Riesch, netdev, Oliver Neukum, Eric Dumazet, Allan Chou,
Mark Lord, Ming Lei, Michael Riesch
In-Reply-To: <1341575919.3265.499.camel@edumazet-glaptop>
On Fri, Jul 6, 2012 at 4:58 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Fri, 2012-07-06 at 13:33 +0200, Christian Riesch wrote:
>> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
>> ---
>
>> - netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret);
>> + netdev_err(dev->net, "Error reading PHYID register: %02x\n",
>> + ret);
>
>
> Thats ridiculous
Agreed. But it's not Christian's fault and I'm pretty sure you aren't
blaming him.
> Not all checkpatch warnings are meaningful.
Agreed.
> I mean, they probably are for new code, but for existing one this is a
> waste of time.
Christian is clearly running checkpatch.pl as suggested in
Documentation/SubmittingPatches. He missed the part about "You should
be able to justify all violations that remain in your patch." and/or
didn't know about "fixing existing code is a waste of time".
Given the extent of the changes Christian is making (factoring out
asix common code from model specific code), it's helpful to have clean
checkpatch runs. I don't believe it's a waste of time to apply this
patch. Is it conflicting with any other code changes that are in
flight now?
thanks,
grant
^ permalink raw reply
* Re: [PATCH 0/4] phylib: add context argument to adjust link callbacks
From: Florian Fainelli @ 2012-07-06 21:41 UTC (permalink / raw)
To: s-paulraj; +Cc: netdev, davem, cyril, grant.likely, linux-keystone
In-Reply-To: <1341604653-19944-1-git-send-email-s-paulraj@ti.com>
Hello Sandeep,
Le vendredi 06 juillet 2012 21:57:33, s-paulraj@ti.com a écrit :
> From: Sandeep Paulraj <s-paulraj@ti.com>
>
> This series of 4 patches adds a new context argument for the adjust link
> callbacks. The existing phy_connect() and its variants don't have a way to
> pass any private context information. This becomes necessary when, a SOC
> has an on chip switch with multiple ports. We need port specific
> information to figure out which port a given callback belongs to.
> We can pass this context information in the phy_connect() and its
> variants. This in turn gets passed into the adjust link callbacks on link
> state change events.
Assuming that you want to use a phydev per one of your switch port, this would
mean that you register multiple phydevs within your ethernet driver. If so,
each phydev is already unique, and most likely also has an unique MDIO bus
address, this makes me wonder what is the purpose of the private pointer then?
>
> NOTE: At this point of time patch 4 in this series passes a "NULL" to
> the phy_connect() and its variants for all drivers that currently use
> phy_connect() and its variants. This patch has been tested on a
> Texas Instruments SOC, patches for which, as of now have not yet been
> upstreamed; as a result of which this patch series does not yet
> have an example of how this new feature is being actually used.
As David will probably tell you, introducing a new interface without any user
does not increase the chance of geting your patches merged ;)
>
> Sandeep Paulraj (4):
> phylib: factor out handler callouts into helper
> phylib: add context argument to adjust link callback
> of/mdio: add context argument to adjust link callback
> net: add context callback parameter to phy connect
>
> drivers/net/ethernet/8390/ax88796.c | 4 ++--
> drivers/net/ethernet/adi/bfin_mac.c | 4 ++--
> drivers/net/ethernet/aeroflex/greth.c | 7 +++---
> drivers/net/ethernet/amd/au1000_eth.c | 4 ++--
> drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++--
> drivers/net/ethernet/broadcom/sb1250-mac.c | 6 ++---
> drivers/net/ethernet/broadcom/tg3.c | 4 ++--
> drivers/net/ethernet/cadence/macb.c | 4 ++--
> drivers/net/ethernet/dnet.c | 6 ++---
> drivers/net/ethernet/ethoc.c | 4 ++--
> drivers/net/ethernet/faraday/ftgmac100.c | 4 ++--
> drivers/net/ethernet/freescale/fec.c | 4 ++--
> drivers/net/ethernet/freescale/fec_mpc52xx.c | 5 ++--
> .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 6 ++---
> drivers/net/ethernet/freescale/gianfar.c | 8 +++----
> drivers/net/ethernet/freescale/ucc_geth.c | 6 ++---
> drivers/net/ethernet/lantiq_etop.c | 4 ++--
> drivers/net/ethernet/nxp/lpc_eth.c | 5 ++--
> drivers/net/ethernet/octeon/octeon_mgmt.c | 4 ++--
> drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
> drivers/net/ethernet/rdc/r6040.c | 4 ++--
> drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
> drivers/net/ethernet/s6gmac.c | 4 ++--
> drivers/net/ethernet/smsc/smsc911x.c | 4 ++--
> drivers/net/ethernet/smsc/smsc9420.c | 5 ++--
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--
> drivers/net/ethernet/ti/cpmac.c | 4 ++--
> drivers/net/ethernet/ti/cpsw.c | 5 ++--
> drivers/net/ethernet/ti/davinci_emac.c | 4 ++--
> drivers/net/ethernet/toshiba/tc35815.c | 5 ++--
> drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
> drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 ++-
> drivers/net/ethernet/xilinx/xilinx_emaclite.c | 5 ++--
> drivers/net/ethernet/xscale/ixp4xx_eth.c | 4 ++--
> drivers/net/phy/phy.c | 25
> ++++++++++++-------- drivers/net/phy/phy_device.c |
> 23 +++++++++++------- drivers/of/of_mdio.c
> | 24 ++++++++++++------- include/linux/of_mdio.h
> | 15 ++++++------ include/linux/phy.h
> | 20 +++++++++------- 39 files changed, 149 insertions(+), 116
> deletions(-)
--
Florian
^ permalink raw reply
* Re: [PATCH] smsc95xx: support ethtool get_regs
From: Émeric Vigier @ 2012-07-06 21:26 UTC (permalink / raw)
To: Francois Romieu; +Cc: Steve Glendinning, steve glendinning, netdev, Nancy Lin
In-Reply-To: <20120706200146.GA11931@electric-eye.fr.zoreil.com>
----- Mail original -----
> De: "Francois Romieu" <romieu@fr.zoreil.com>
> À: "Émeric Vigier" <emeric.vigier@savoirfairelinux.com>
> Cc: "Steve Glendinning" <steve@shawell.net>, "steve glendinning" <steve.glendinning@smsc.com>,
> netdev@vger.kernel.org, "Nancy Lin" <nancy.lin@smsc.com>
> Envoyé: Vendredi 6 Juillet 2012 16:01:46
> Objet: Re: [PATCH] smsc95xx: support ethtool get_regs
>
> Émeric Vigier <emeric.vigier@savoirfairelinux.com> :
> [...]
> > +static int smsc95xx_ethtool_getregslen(struct net_device *dev)
> > +{
> > + /* all smsc95xx registers plus all phy registers */
> > + return COE_CR - ID_REV + 1 + 32 * sizeof(u32);
>
> I do not see where ID_REV is accounted for in the loops below.
>
> s/32 */PHY_SPECIAL */ or s/PHY_SPECIAL/32/ below.
I will go for the second proposal. I love your sed syntax btw :-)
>
> I thought PHY registers were 16 bits wide. Moreover they are already
> available through smsc95xx_ioctl().
Yes, there are 16 bits wide according to smsc95xx.h.
But other smsc drivers define 32bit wide PHY regs. I made myself believe that smsc would use the same PHY for each ethernet chip.
So would something like s/32 * sizeof(u32)/PHY_SPECIAL * sizeof(u16)/ solve the issue here?
Concerning the ioctl, I found ethtool much easier to use. And I believe smsc9514 is a very popular chipset, so this could help others debugging it.
>
> > +}
> > +
> > +static void
> > +smsc95xx_ethtool_getregs(struct net_device *netdev, struct
> > ethtool_regs *regs,
> > + void *buf)
> > +{
> > + struct usbnet *dev = netdev_priv(netdev);
> > + unsigned int i, j = 0, retval;
>
> unsigned int i, j, retval;
>
> > + u32 *data = buf;
> > +
> > + netif_dbg(dev, hw, dev->net, "ethtool_getregs\n");
>
> The tracing framework does provide almost the same information.
Do you mean LTT? I am not familiar with it, I should have a look.
I remove netif_dbg then.
>
> > +
> > + retval = smsc95xx_read_reg(dev, ID_REV, ®s->version);
> > + if (retval < 0) {
> > + netdev_warn(dev->net, "REGS: cannot read ID_REV\n");
>
> s/dev->net/netdev/ ?
You are right, I also changed smsc95xx_ethtool_getregslen() definition to match this syntax.
>
>
> > + return;
> > + }
> > +
> > + for (i = 0; i <= COE_CR; i += (sizeof(u32))) {
> > + retval = smsc95xx_read_reg(dev, i, &data[j++]);
>
> for (i = 0, j = 0; i <= COE_CR; i += sizeof(u32), j++) {
> retval = smsc95xx_read_reg(dev, i, data + j);
I should change that in previous "for" loop as well I suppose?
>
> --
> Ueimor
>
Emeric
^ permalink raw reply
* [PATCH net,1/1] hyperv: Add support for setting MAC from within guests
From: Haiyang Zhang @ 2012-07-06 21:25 UTC (permalink / raw)
To: davem, netdev; +Cc: haiyangz, kys, olaf, linux-kernel, devel
This adds support for setting synthetic NIC MAC address from within Linux
guests. Before using this feature, the option "spoofing of MAC address"
should be enabled at the Hyper-V manager / Settings of the synthetic
NIC.
Thanks to Kin Cho <kcho@infoblox.com> for the initial implementation and
tests. And, thanks to Long Li <longli@microsoft.com> for the debugging
works.
Reported-and-tested-by: Kin Cho <kcho@infoblox.com>
Reported-by: Long Li <longli@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/hyperv_net.h | 1 +
drivers/net/hyperv/netvsc_drv.c | 30 +++++++++++++-
drivers/net/hyperv/rndis_filter.c | 79 +++++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+), 1 deletions(-)
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 2857ab0..95ceb35 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -131,6 +131,7 @@ int rndis_filter_send(struct hv_device *dev,
struct hv_netvsc_packet *pkt);
int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter);
+int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac);
#define NVSP_INVALID_PROTOCOL_VERSION ((u32)0xFFFFFFFF)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 8f8ed33..8e23c08 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -341,6 +341,34 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
return 0;
}
+
+static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
+{
+ struct net_device_context *ndevctx = netdev_priv(ndev);
+ struct hv_device *hdev = ndevctx->device_ctx;
+ struct sockaddr *addr = p;
+ char save_adr[14];
+ unsigned char save_aatype;
+ int err;
+
+ memcpy(save_adr, ndev->dev_addr, ETH_ALEN);
+ save_aatype = ndev->addr_assign_type;
+
+ err = eth_mac_addr(ndev, p);
+ if (err != 0)
+ return err;
+
+ err = rndis_filter_set_device_mac(hdev, addr->sa_data);
+ if (err != 0) {
+ /* roll back to saved MAC */
+ memcpy(ndev->dev_addr, save_adr, ETH_ALEN);
+ ndev->addr_assign_type = save_aatype;
+ }
+
+ return err;
+}
+
+
static const struct ethtool_ops ethtool_ops = {
.get_drvinfo = netvsc_get_drvinfo,
.get_link = ethtool_op_get_link,
@@ -353,7 +381,7 @@ static const struct net_device_ops device_ops = {
.ndo_set_rx_mode = netvsc_set_multicast_list,
.ndo_change_mtu = netvsc_change_mtu,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = netvsc_set_mac_addr,
};
/*
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 981ebb1..fbf5394 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -27,6 +27,7 @@
#include <linux/if_ether.h>
#include <linux/netdevice.h>
#include <linux/if_vlan.h>
+#include <linux/nls.h>
#include "hyperv_net.h"
@@ -47,6 +48,7 @@ struct rndis_request {
struct hv_page_buffer buf;
/* FIXME: We assumed a fixed size request here. */
struct rndis_message request_msg;
+ u8 ext[100];
};
static void rndis_filter_send_completion(void *ctx);
@@ -511,6 +513,83 @@ static int rndis_filter_query_device_mac(struct rndis_device *dev)
dev->hw_mac_adr, &size);
}
+#define NWADR_STR "NetworkAddress"
+#define NWADR_STRLEN 14
+
+int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac)
+{
+ struct netvsc_device *nvdev = hv_get_drvdata(hdev);
+ struct rndis_device *rdev = nvdev->extension;
+ struct net_device *ndev = nvdev->ndev;
+ struct rndis_request *request;
+ struct rndis_set_request *set;
+ struct rndis_config_parameter_info *cpi;
+ wchar_t *cfg_nwadr, *cfg_mac;
+ struct rndis_set_complete *set_complete;
+ char macstr[2*ETH_ALEN+1];
+ u32 extlen = sizeof(struct rndis_config_parameter_info) +
+ 2*NWADR_STRLEN + 4*ETH_ALEN;
+ int ret, t;
+
+ request = get_rndis_request(rdev, RNDIS_MSG_SET,
+ RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
+ if (!request)
+ return -ENOMEM;
+
+ set = &request->request_msg.msg.set_req;
+ set->oid = RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER;
+ set->info_buflen = extlen;
+ set->info_buf_offset = sizeof(struct rndis_set_request);
+ set->dev_vc_handle = 0;
+
+ cpi = (struct rndis_config_parameter_info *)((ulong)set +
+ set->info_buf_offset);
+ cpi->parameter_name_offset =
+ sizeof(struct rndis_config_parameter_info);
+ /* Multiply by 2 because host needs 2 bytes (utf16) for each char */
+ cpi->parameter_name_length = 2*NWADR_STRLEN;
+ cpi->parameter_type = RNDIS_CONFIG_PARAM_TYPE_STRING;
+ cpi->parameter_value_offset =
+ cpi->parameter_name_offset + cpi->parameter_name_length;
+ /* Multiply by 4 because each MAC byte displayed as 2 utf16 chars */
+ cpi->parameter_value_length = 4*ETH_ALEN;
+
+ cfg_nwadr = (wchar_t *)((ulong)cpi + cpi->parameter_name_offset);
+ cfg_mac = (wchar_t *)((ulong)cpi + cpi->parameter_value_offset);
+ ret = utf8s_to_utf16s(NWADR_STR, NWADR_STRLEN, UTF16_HOST_ENDIAN,
+ cfg_nwadr, NWADR_STRLEN);
+ if (ret < 0)
+ goto cleanup;
+ snprintf(macstr, 2*ETH_ALEN+1, "%pm", mac);
+ ret = utf8s_to_utf16s(macstr, 2*ETH_ALEN, UTF16_HOST_ENDIAN,
+ cfg_mac, 2*ETH_ALEN);
+ if (ret < 0)
+ goto cleanup;
+
+ ret = rndis_filter_send_request(rdev, request);
+ if (ret != 0)
+ goto cleanup;
+
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+ if (t == 0) {
+ netdev_err(ndev, "timeout before we got a set response...\n");
+ /*
+ * can't put_rndis_request, since we may still receive a
+ * send-completion.
+ */
+ return -EBUSY;
+ } else {
+ set_complete = &request->response_msg.msg.set_complete;
+ if (set_complete->status != RNDIS_STATUS_SUCCESS)
+ ret = -EINVAL;
+ }
+
+cleanup:
+ put_rndis_request(rdev, request);
+ return ret;
+}
+
+
static int rndis_filter_query_device_link_status(struct rndis_device *dev)
{
u32 size = sizeof(u32);
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH 4/4] asix: Add a new driver for the AX88172A
From: Grant Grundler @ 2012-07-06 21:20 UTC (permalink / raw)
To: Christian Riesch
Cc: netdev, Oliver Neukum, Eric Dumazet, Allan Chou, Mark Lord,
Ming Lei, Michael Riesch
In-Reply-To: <1341574388-7464-5-git-send-email-christian.riesch@omicron.at>
On Fri, Jul 6, 2012 at 4:33 AM, Christian Riesch
<christian.riesch@omicron.at> wrote:
> The Asix AX88172A is a USB 2.0 Ethernet interface that supports both an
> internal PHY as well as an external PHY (connected via MII).
>
> This patch adds a driver for the AX88172A and provides support for
> both modes and supports phylib.
Christian,
In general this looks fine to me...but I wouldn't know about "bus
identifier life times" (Ben Hutchings comment).
My nit pick is the declaration and of use_embdphy. An alternative
coding _suggestion_ below. I'm not substantially altering the
functionality.
thanks,
grant
>
> Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
> ---
> drivers/net/usb/Makefile | 2 +-
> drivers/net/usb/asix_devices.c | 6 +
> drivers/net/usb/ax88172a.c | 407 ++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 414 insertions(+), 1 deletions(-)
> create mode 100644 drivers/net/usb/ax88172a.c
>
> diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
> index a9490d9..bf06300 100644
> --- a/drivers/net/usb/Makefile
> +++ b/drivers/net/usb/Makefile
> @@ -8,7 +8,7 @@ obj-$(CONFIG_USB_PEGASUS) += pegasus.o
> obj-$(CONFIG_USB_RTL8150) += rtl8150.o
> obj-$(CONFIG_USB_HSO) += hso.o
> obj-$(CONFIG_USB_NET_AX8817X) += asix.o
> -asix-y := asix_devices.o asix_common.o
> +asix-y := asix_devices.o asix_common.o ax88172a.o
> obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o
> obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o
> obj-$(CONFIG_USB_NET_DM9601) += dm9601.o
> diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
> index c8682a5..02b8c21 100644
> --- a/drivers/net/usb/asix_devices.c
> +++ b/drivers/net/usb/asix_devices.c
> @@ -877,6 +877,8 @@ static const struct driver_info ax88178_info = {
> .tx_fixup = asix_tx_fixup,
> };
>
> +extern const struct driver_info ax88172a_info;
> +
> static const struct usb_device_id products[] = {
> {
> /* Linksys USB200M */
> @@ -1002,6 +1004,10 @@ static const struct usb_device_id products[] = {
> /* Asus USB Ethernet Adapter */
> USB_DEVICE(0x0b95, 0x7e2b),
> .driver_info = (unsigned long) &ax88772_info,
> +}, {
> + /* ASIX 88172a demo board */
> + USB_DEVICE(0x0b95, 0x172a),
> + .driver_info = (unsigned long) &ax88172a_info,
> },
> { }, /* END */
> };
> diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
> new file mode 100644
> index 0000000..9f2d1fd
> --- /dev/null
> +++ b/drivers/net/usb/ax88172a.c
> @@ -0,0 +1,407 @@
> +/*
> + * ASIX AX88172A based USB 2.0 Ethernet Devices
> + * Copyright (C) 2012 OMICRON electronics GmbH
> + *
> + * Supports external PHYs via phylib. Based on the driver for the
> + * AX88772. Original copyrights follow:
> + *
> + * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
> + * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
> + * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
> + * Copyright (c) 2002-2003 TiVo Inc.
> + *
> + * 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.
> + *
> + * 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
> + */
> +
> +#include "asix.h"
> +#include <linux/phy.h>
> +
> +struct ax88172a_private {
> + int use_embdphy;
Can you move the "int" to the end of the struct?
It's cleaner to have fields "natively align". ie pointers should start
at 8 byte alignments when compiled for 64-bit.
> + struct mii_bus *mdio;
> + struct phy_device *phydev;
> + char phy_name[20];
> + u16 phy_addr;
> + u16 oldmode;
> +};
> +
> +static inline int asix_read_phy_addr(struct usbnet *dev, int internal)
> +{
> + int offset = (internal ? 1 : 0);
One could use "internal" parameter directly for indexing if
use_embdphy were renamed to use_extphy and the logic inverted..
> + u8 buf[2];
> + int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf);
> +
> + netdev_dbg(dev->net, "asix_get_phy_addr()\n");
> +
> + if (ret < 0) {
> + netdev_err(dev->net, "Error reading PHYID register: %02x\n",
> + ret);
> + goto out;
> + }
> + netdev_dbg(dev->net, "asix_get_phy_addr() returning 0x%04x\n",
> + *((__le16 *)buf));
> + ret = buf[offset];
> +
> +out:
> + return ret;
> +}
> +
> +static int ax88172a_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
> +{
> + return phy_mii_ioctl(net->phydev, rq, cmd);
> +}
> +
> +/* MDIO read and write wrappers for phylib */
> +static int asix_mdio_bus_read(struct mii_bus *bus, int phy_id, int regnum)
> +{
> + return asix_mdio_read(((struct usbnet *)bus->priv)->net, phy_id,
> + regnum);
> +}
> +
> +static int asix_mdio_bus_write(struct mii_bus *bus, int phy_id, int regnum,
> + u16 val)
> +{
> + asix_mdio_write(((struct usbnet *)bus->priv)->net, phy_id, regnum,
> + val);
> + return 0;
> +}
> +
> +/* set MAC link settings according to information from phylib */
> +static void asix_adjust_link(struct net_device *netdev)
> +{
> + struct phy_device *phydev = netdev->phydev;
> + struct usbnet *dev = netdev_priv(netdev);
> + struct ax88172a_private *priv =
> + (struct ax88172a_private *)dev->driver_priv;
> + u16 mode = 0;
> +
> + dbg("asix_adjust_link called\n");
> +
> + if (phydev->link) {
> + mode = AX88772_MEDIUM_DEFAULT;
> +
> + if (phydev->duplex == DUPLEX_HALF)
> + mode &= ~AX_MEDIUM_FD;
> +
> + if (phydev->speed != SPEED_100)
> + mode &= ~AX_MEDIUM_PS;
> + }
> +
> + if (mode != priv->oldmode) {
> + asix_write_medium_mode(dev, mode);
> + priv->oldmode = mode;
> + dbg("asix_adjust_link speed: %u duplex: %d setting mode to 0x%04x\n",
> + phydev->speed, phydev->duplex, mode);
> + phy_print_status(phydev);
> + }
> +}
> +
> +static void ax88172a_status(struct usbnet *dev, struct urb *urb)
> +{
> +}
> +
> +/* use phylib infrastructure */
> +static int ax88172a_init_mdio(struct usbnet *dev)
> +{
> + struct ax88172a_private *priv =
> + (struct ax88172a_private *)dev->driver_priv;
> + int ret, i;
> +
> + priv->mdio = mdiobus_alloc();
> + if (!priv->mdio) {
> + dbg("Could not allocate MDIO bus");
> + return -1;
> + }
> +
> + priv->mdio->priv = (void *)dev;
> + priv->mdio->read = &asix_mdio_bus_read;
> + priv->mdio->write = &asix_mdio_bus_write;
> + priv->mdio->name = "Asix MDIO Bus";
> + snprintf(priv->mdio->id, MII_BUS_ID_SIZE, "asix-%s",
> + dev_name(dev->net->dev.parent));
> +
> + priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
> + if (!priv->mdio->irq) {
> + dbg("Could not allocate MDIO->IRQ");
> + ret = -ENOMEM;
> + goto mfree;
> + }
> + for (i = 0; i < PHY_MAX_ADDR; i++)
> + priv->mdio->irq[i] = PHY_POLL;
> +
> + ret = mdiobus_register(priv->mdio);
> + if (ret) {
> + dbg("Could not register MDIO bus");
> + goto ifree;
> + }
> + snprintf(priv->phy_name, 20, PHY_ID_FMT,
> + priv->mdio->id, priv->phy_addr);
> +
> + priv->phydev = phy_connect(dev->net, priv->phy_name, &asix_adjust_link,
> + 0, PHY_INTERFACE_MODE_MII);
> + if (IS_ERR(priv->phydev)) {
> + dbg("Could not connect to PHY device");
> + ret = PTR_ERR(priv->phydev);
> + goto munreg;
> + }
> + dbg("dev->net->phydev (%s) is now 0x%p", priv->phy_name,
> + dev->net->phydev);
> +
> + /* During power-up, the AX88172A set the power down (BMCR_PDOWN)
> + * bit of the PHY. Bring the PHY up again.
> + */
> + genphy_resume(priv->phydev);
> +
> + phy_start(priv->phydev);
> +
> + return 0;
> +munreg:
> + mdiobus_unregister(priv->mdio);
> +ifree:
> + kfree(priv->mdio->irq);
> +mfree:
> + mdiobus_free(priv->mdio);
> + return ret;
> +}
> +
> +static void ax88172a_remove_mdio(struct usbnet *dev)
> +{
> + struct ax88172a_private *priv =
> + (struct ax88172a_private *)dev->driver_priv;
> +
> + phy_stop(priv->phydev);
> + phy_disconnect(priv->phydev);
> + mdiobus_unregister(priv->mdio);
> + kfree(priv->mdio->irq);
> + mdiobus_free(priv->mdio);
> +}
> +
> +static const struct net_device_ops ax88172a_netdev_ops = {
> + .ndo_open = usbnet_open,
> + .ndo_stop = usbnet_stop,
> + .ndo_start_xmit = usbnet_start_xmit,
> + .ndo_tx_timeout = usbnet_tx_timeout,
> + .ndo_change_mtu = usbnet_change_mtu,
> + .ndo_set_mac_address = asix_set_mac_address,
> + .ndo_validate_addr = eth_validate_addr,
> + .ndo_do_ioctl = ax88172a_ioctl,
> + .ndo_set_rx_mode = asix_set_multicast,
> +};
> +
> +int ax88172a_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
> +{
> + return phy_ethtool_gset(net->phydev, cmd);
> +}
> +
> +int ax88172a_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
> +{
> + return phy_ethtool_sset(net->phydev, cmd);
> +}
> +
> +int ax88172a_nway_reset(struct net_device *net)
> +{
> + return phy_start_aneg(net->phydev);
> +}
> +
> +static const struct ethtool_ops ax88172a_ethtool_ops = {
> + .get_drvinfo = asix_get_drvinfo,
> + .get_link = usbnet_get_link,
> + .get_msglevel = usbnet_get_msglevel,
> + .set_msglevel = usbnet_set_msglevel,
> + .get_wol = asix_get_wol,
> + .set_wol = asix_set_wol,
> + .get_eeprom_len = asix_get_eeprom_len,
> + .get_eeprom = asix_get_eeprom,
> + .get_settings = ax88172a_get_settings,
> + .set_settings = ax88172a_set_settings,
> + .nway_reset = ax88172a_nway_reset,
> +};
> +
> +static int ax88172a_reset_phy(struct usbnet *dev, int embd_phy)
> +{
> + int ret;
> +
> + ret = asix_sw_reset(dev, AX_SWRESET_IPPD);
> + if (ret < 0)
> + goto err;
> +
> + msleep(150);
> + ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
> + if (ret < 0)
> + goto err;
> +
> + msleep(150);
> +
> + ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_IPPD);
(would have to swap things here if adopting my suggestions.)
> + if (ret < 0)
> + goto err;
> +
> + return 0;
> +
> +err:
> + return ret;
> +}
> +
> +
> +static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
> +{
> + int ret;
> + struct asix_data *data = (struct asix_data *)&dev->data;
> + u8 buf[ETH_ALEN];
> + struct ax88172a_private *priv;
> +
> + data->eeprom_len = AX88772_EEPROM_LEN;
> +
> + usbnet_get_endpoints(dev, intf);
> +
> + priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> + if (!priv) {
> + dbg("Could not allocate memory for private data");
> + return -ENOMEM;
> + }
> + dev->driver_priv = priv;
> +
> + /* Get the MAC address */
> + ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
> + if (ret < 0) {
> + dbg("Failed to read MAC address: %d", ret);
> + goto free;
> + }
> + memcpy(dev->net->dev_addr, buf, ETH_ALEN);
> +
> + dev->net->netdev_ops = &ax88172a_netdev_ops;
> + dev->net->ethtool_ops = &ax88172a_ethtool_ops;
> +
> + /* are we using the internal or the external phy? */
> + ret = asix_read_cmd(dev, AX_CMD_SW_PHY_STATUS, 0, 0, 1, buf);
> + if (ret < 0) {
> + dbg("Failed to read software interface selection register: %d",
> + ret);
> + goto free;
> + }
> + dbg("AX_CMD_SW_PHY_STATUS = 0x%02x\n", buf[0]);
> + switch ((buf[0] & 0x0c) >> 2) {
> + case 0:
> + dbg("use internal phy\n");
> + priv->use_embdphy = 1;
> + break;
> + case 1:
> + dbg("use external phy\n");
> + priv->use_embdphy = 0;
> + break;
> + default:
> + dbg("Interface mode not supported by driver\n");
> + goto free;
> + }
This switch statement inverts the existing logic. Much simpler code would be:
/* buf[0] & 0xc describes phy interface mode */
if (buf[0] & 8) {
dbg("Interface mode not supported by driver\n");
goto free;
}
priv->use_extphy = (buf[0] & 4) >> 2;
> +
> + priv->phy_addr = asix_read_phy_addr(dev, priv->use_embdphy);
> + ax88172a_reset_phy(dev, priv->use_embdphy);
> +
> + /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
> + if (dev->driver_info->flags & FLAG_FRAMING_AX) {
> + /* hard_mtu is still the default - the device does not support
> + jumbo eth frames */
> + dev->rx_urb_size = 2048;
> + }
> +
> + /* init MDIO bus */
> + ret = ax88172a_init_mdio(dev);
> + if (ret)
> + goto free;
> +
> + return 0;
> +
> +free:
> + kfree(priv);
> + return ret;
> +}
> +
> +static void ax88172a_unbind(struct usbnet *dev, struct usb_interface *intf)
> +{
> + struct ax88172a_private *priv =
> + (struct ax88172a_private *)dev->driver_priv;
> +
> + ax88172a_remove_mdio(dev);
> + kfree(priv);
> +}
> +
> +static int ax88172a_reset(struct usbnet *dev)
> +{
> + struct asix_data *data = (struct asix_data *)&dev->data;
> + struct ax88172a_private *priv =
> + (struct ax88172a_private *)dev->driver_priv;
> + int ret;
> + u16 rx_ctl;
> +
> + ax88172a_reset_phy(dev, priv->use_embdphy);
> +
> + msleep(150);
> + rx_ctl = asix_read_rx_ctl(dev);
> + dbg("RX_CTL is 0x%04x after software reset", rx_ctl);
> + ret = asix_write_rx_ctl(dev, 0x0000);
> + if (ret < 0)
> + goto out;
> +
> + rx_ctl = asix_read_rx_ctl(dev);
> + dbg("RX_CTL is 0x%04x setting to 0x0000", rx_ctl);
> +
> + msleep(150);
> +
> + ax88172a_nway_reset(dev->net);
> +
> + ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
> + AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
> + AX88772_IPG2_DEFAULT, 0, NULL);
> + if (ret < 0) {
> + dbg("Write IPG,IPG1,IPG2 failed: %d", ret);
> + goto out;
> + }
> +
> + /* Rewrite MAC address */
> + memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
> + ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
> + data->mac_addr);
> + if (ret < 0)
> + goto out;
> +
> + /* Set RX_CTL to default values with 2k buffer, and enable cactus */
> + ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
> + if (ret < 0)
> + goto out;
> +
> + rx_ctl = asix_read_rx_ctl(dev);
> + dbg("RX_CTL is 0x%04x after all initializations", rx_ctl);
> +
> + rx_ctl = asix_read_medium_status(dev);
> + dbg("Medium Status is 0x%04x after all initializations", rx_ctl);
> +
> + return 0;
> +
> +out:
> + return ret;
> +
> +}
> +
> +const struct driver_info ax88172a_info = {
> + .description = "ASIX AX88172A USB 2.0 Ethernet",
> + .bind = ax88172a_bind,
> + .unbind = ax88172a_unbind,
> + .status = ax88172a_status,
> + .reset = ax88172a_reset,
> + .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
> + FLAG_MULTI_PACKET,
> + .rx_fixup = asix_rx_fixup,
> + .tx_fixup = asix_tx_fixup,
> +};
> --
> 1.7.0.4
>
^ permalink raw reply
* Re: [RFC PATCH] bridge: netfilter: fix skb->nf_bridge NULL panic in br_nf_forward_finish
From: Julian Anastasov @ 2012-07-06 20:34 UTC (permalink / raw)
To: Lin Ming
Cc: Massimo Cetra, Eric Dumazet, netdev, Stephen Hemminger,
David S. Miller
In-Reply-To: <1341584394.4789.34.camel@chief-river-32>
Hello,
On Fri, 6 Jul 2012, Lin Ming wrote:
> I can reproduce similiar panic with 3.5-rc5 kernel as Massimo reported at:
> http://marc.info/?l=linux-netdev&m=134089242113979&w=2
>
> The steps to reproduce as follow,
>
> 1. On Host1, setup brige br0(192.168.1.106)
> 2. Boot a kvm guest(192.168.1.105) on Host1 and start httpd
> 3. Start IPVS service on Host1
> ipvsadm -A -t 192.168.1.106:80 -s rr
> ipvsadm -a -t 192.168.1.106:80 -r 192.168.1.105:80 -m
> 4. Run apache benchmark on Host2(192.168.1.101)
> ab -n 1000 http://192.168.1.106/
>
> The panic happened in br_nf_forward_finish because skb->nf_bridge is NULL.
> skb->nf_bridge is set to NULL in ip_vs_reply4 hook.
>
> br_nf_forward_ip():
> NF_HOOK(pf, NF_INET_FORWARD, skb, brnf_get_logical_dev(skb, in), parent,
> br_nf_forward_finish);
>
> This calls IPVS hook ip_vs_reply4.
>
> ip_vs_reply4
> ip_vs_out
> handle_response
> ip_vs_notrack
> nf_reset()
> {
> skb->nf_bridge = NULL;
> }
Actually, IPVS wants in this case just to replace nfct
with untracked version. May be it is better to replace
the nf_reset(skb) call in ip_vs_notrack() with a
nf_conntrack_put(skb->nfct) call. Can you test and post
such patch?
> This patch added skb->nf_bridge check in br_nf_forward_finish and the panic gone.
> But I am really not sure if this is the right fix.
> Please help to review.
>
> The panic log attached.
>
> [ 579.781508] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
> [ 579.781669] IP: [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
> [ 579.781792] PGD 218f9067 PUD 0
> [ 579.781865] Oops: 0000 [#1] SMP
> [ 579.781945] CPU 0
> [ 579.781983] Modules linked in:
> [ 579.782047]
> [ 579.782080]
> [ 579.782114] Pid: 4644, comm: qemu Tainted: G W 3.5.0-rc5-00006-g95e69f9 #282 Hewlett-Packard /30E8
> [ 579.782300] RIP: 0010:[<ffffffff817b1ca5>] [<ffffffff817b1ca5>] br_nf_forward_finish+0x58/0x112
> [ 579.782455] RSP: 0018:ffff88007b003a98 EFLAGS: 00010287
> [ 579.782541] RAX: 0000000000000008 RBX: ffff8800762ead00 RCX: 000000000001670a
> [ 579.782653] RDX: 0000000000000000 RSI: 000000000000000a RDI: ffff8800762ead00
> [ 579.782845] RBP: ffff88007b003ac8 R08: 0000000000016630 R09: ffff88007b003a90
> [ 579.782957] R10: ffff88007b0038e8 R11: ffff88002da37540 R12: ffff88002da01a02
> [ 579.783066] R13: ffff88002da01a80 R14: ffff88002d83c000 R15: ffff88002d82a000
> [ 579.783177] FS: 0000000000000000(0000) GS:ffff88007b000000(0063) knlGS:00000000f62d1b70
> [ 579.783306] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
> [ 579.783395] CR2: 0000000000000004 CR3: 00000000218fe000 CR4: 00000000000027f0
> [ 579.783505] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 579.783684] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [ 579.783795] Process qemu (pid: 4644, threadinfo ffff880021b20000, task ffff880021aba760)
> [ 579.783919] Stack:
> [ 579.783959] ffff88007693cedc ffff8800762ead00 ffff88002da01a02 ffff8800762ead00
> [ 579.784110] ffff88002da01a02 ffff88002da01a80 ffff88007b003b18 ffffffff817b26c7
> [ 579.784260] ffff880080000000 ffffffff81ef59f0 ffff8800762ead00 ffffffff81ef58b0
> [ 579.784477] Call Trace:
> [ 579.784523] <IRQ>
> [ 579.784562]
> [ 579.784603] [<ffffffff817b26c7>] br_nf_forward_ip+0x275/0x2c8
> [ 579.784707] [<ffffffff81704b58>] nf_iterate+0x47/0x7d
> [ 579.784797] [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
> [ 579.784906] [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
> [ 579.784995] [<ffffffff817ac32e>] ? br_dev_queue_push_xmit+0xae/0xae
> [ 579.785175] [<ffffffff8187fa95>] ? _raw_write_unlock_bh+0x19/0x1b
> [ 579.785179] [<ffffffff817ac417>] __br_forward+0x97/0xa2
> [ 579.785179] [<ffffffff817ad366>] br_handle_frame_finish+0x1a6/0x257
> [ 579.785179] [<ffffffff817b2386>] br_nf_pre_routing_finish+0x26d/0x2cb
> [ 579.785179] [<ffffffff817b2cf0>] br_nf_pre_routing+0x55d/0x5c1
> [ 579.785179] [<ffffffff81704b58>] nf_iterate+0x47/0x7d
> [ 579.785179] [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
> [ 579.785179] [<ffffffff81704bfb>] nf_hook_slow+0x6d/0x102
> [ 579.785179] [<ffffffff817ad1c0>] ? br_handle_local_finish+0x44/0x44
> [ 579.785179] [<ffffffff81551525>] ? sky2_poll+0xb35/0xb54
> [ 579.785179] [<ffffffff817ad62a>] br_handle_frame+0x213/0x229
> [ 579.785179] [<ffffffff817ad417>] ? br_handle_frame_finish+0x257/0x257
> [ 579.785179] [<ffffffff816e3b47>] __netif_receive_skb+0x2b4/0x3f1
> [ 579.785179] [<ffffffff816e69fc>] process_backlog+0x99/0x1e2
> [ 579.785179] [<ffffffff816e6800>] net_rx_action+0xdf/0x242
> [ 579.785179] [<ffffffff8107e8a8>] __do_softirq+0xc1/0x1e0
> [ 579.785179] [<ffffffff8135a5ba>] ? trace_hardirqs_off_thunk+0x3a/0x6c
> [ 579.785179] [<ffffffff8188812c>] call_softirq+0x1c/0x30
>
> Signed-off-by: Lin Ming <mlin@ss.pku.edu.cn>
> ---
> net/bridge/br_netfilter.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> index e41456b..10da415 100644
> --- a/net/bridge/br_netfilter.c
> +++ b/net/bridge/br_netfilter.c
> @@ -719,7 +719,7 @@ static int br_nf_forward_finish(struct sk_buff *skb)
> struct nf_bridge_info *nf_bridge = skb->nf_bridge;
> struct net_device *in;
>
> - if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
> + if (!IS_ARP(skb) && !IS_VLAN_ARP(skb) && nf_bridge) {
> in = nf_bridge->physindev;
> if (nf_bridge->mask & BRNF_PKT_TYPE) {
> skb->pkt_type = PACKET_OTHERHOST;
> --
> 1.7.2.5
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [PATCH] smsc95xx: support ethtool get_regs
From: Francois Romieu @ 2012-07-06 20:01 UTC (permalink / raw)
To: Émeric Vigier
Cc: Steve Glendinning, steve glendinning, netdev, Nancy Lin
In-Reply-To: <1847398984.224080.1341598531284.JavaMail.root@mail.savoirfairelinux.com>
Émeric Vigier <emeric.vigier@savoirfairelinux.com> :
[...]
> +static int smsc95xx_ethtool_getregslen(struct net_device *dev)
> +{
> + /* all smsc95xx registers plus all phy registers */
> + return COE_CR - ID_REV + 1 + 32 * sizeof(u32);
I do not see where ID_REV is accounted for in the loops below.
s/32 */PHY_SPECIAL */ or s/PHY_SPECIAL/32/ below.
I thought PHY registers were 16 bits wide. Moreover they are already
available through smsc95xx_ioctl().
> +}
> +
> +static void
> +smsc95xx_ethtool_getregs(struct net_device *netdev, struct ethtool_regs *regs,
> + void *buf)
> +{
> + struct usbnet *dev = netdev_priv(netdev);
> + unsigned int i, j = 0, retval;
unsigned int i, j, retval;
> + u32 *data = buf;
> +
> + netif_dbg(dev, hw, dev->net, "ethtool_getregs\n");
The tracing framework does provide almost the same information.
> +
> + retval = smsc95xx_read_reg(dev, ID_REV, ®s->version);
> + if (retval < 0) {
> + netdev_warn(dev->net, "REGS: cannot read ID_REV\n");
s/dev->net/netdev/ ?
> + return;
> + }
> +
> + for (i = 0; i <= COE_CR; i += (sizeof(u32))) {
> + retval = smsc95xx_read_reg(dev, i, &data[j++]);
for (i = 0, j = 0; i <= COE_CR; i += sizeof(u32), j++) {
retval = smsc95xx_read_reg(dev, i, data + j);
--
Ueimor
^ permalink raw reply
* [PATCH 4/4] net: add context callback parameter to phy connect
From: s-paulraj @ 2012-07-06 20:10 UTC (permalink / raw)
To: netdev, davem, cyril, grant.likely, linux-keystone; +Cc: Sandeep Paulraj
From: Sandeep Paulraj <s-paulraj@ti.com>
This patch introduces a context argument for the adjust link callback in all
drivers that currently use the phy_connect() and it variants.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
drivers/net/ethernet/8390/ax88796.c | 4 ++--
drivers/net/ethernet/adi/bfin_mac.c | 4 ++--
drivers/net/ethernet/aeroflex/greth.c | 7 ++++---
drivers/net/ethernet/amd/au1000_eth.c | 4 ++--
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++--
drivers/net/ethernet/broadcom/sb1250-mac.c | 6 +++---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
drivers/net/ethernet/cadence/macb.c | 4 ++--
drivers/net/ethernet/dnet.c | 6 +++---
drivers/net/ethernet/ethoc.c | 4 ++--
drivers/net/ethernet/faraday/ftgmac100.c | 4 ++--
drivers/net/ethernet/freescale/fec.c | 4 ++--
drivers/net/ethernet/freescale/fec_mpc52xx.c | 5 +++--
.../net/ethernet/freescale/fs_enet/fs_enet-main.c | 6 +++---
drivers/net/ethernet/freescale/gianfar.c | 8 ++++----
drivers/net/ethernet/freescale/ucc_geth.c | 6 +++---
drivers/net/ethernet/lantiq_etop.c | 4 ++--
drivers/net/ethernet/nxp/lpc_eth.c | 5 +++--
drivers/net/ethernet/octeon/octeon_mgmt.c | 4 ++--
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
drivers/net/ethernet/rdc/r6040.c | 4 ++--
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
drivers/net/ethernet/s6gmac.c | 4 ++--
drivers/net/ethernet/smsc/smsc911x.c | 4 ++--
drivers/net/ethernet/smsc/smsc9420.c | 5 +++--
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++--
drivers/net/ethernet/ti/cpmac.c | 4 ++--
drivers/net/ethernet/ti/cpsw.c | 5 +++--
drivers/net/ethernet/ti/davinci_emac.c | 4 ++--
drivers/net/ethernet/toshiba/tc35815.c | 5 +++--
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 ++-
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 5 +++--
drivers/net/ethernet/xscale/ixp4xx_eth.c | 4 ++--
34 files changed, 84 insertions(+), 74 deletions(-)
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c
index 203ff9d..ef02795 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -317,7 +317,7 @@ static void ax_block_output(struct net_device *dev, int count,
#define AX_MEMR_EEO BIT(6)
#define AX_MEMR_EECLK BIT(7)
-static void ax_handle_link_change(struct net_device *dev)
+static void ax_handle_link_change(struct net_device *dev, void *context)
{
struct ax_device *ax = to_ax_dev(dev);
struct phy_device *phy_dev = ax->phy_dev;
@@ -359,7 +359,7 @@ static int ax_mii_probe(struct net_device *dev)
}
ret = phy_connect_direct(dev, phy_dev, ax_handle_link_change, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (ret) {
netdev_err(dev, "Could not attach to PHY\n");
return ret;
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index f816426..55d1f99 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -313,7 +313,7 @@ static int bfin_mdiobus_reset(struct mii_bus *bus)
return 0;
}
-static void bfin_mac_adjust_link(struct net_device *dev)
+static void bfin_mac_adjust_link(struct net_device *dev, void *context)
{
struct bfin_mac_local *lp = netdev_priv(dev);
struct phy_device *phydev = lp->phydev;
@@ -426,7 +426,7 @@ static int mii_probe(struct net_device *dev, int phy_mode)
}
phydev = phy_connect(dev, dev_name(&phydev->dev), &bfin_mac_adjust_link,
- 0, phy_mode);
+ 0, phy_mode, NULL);
if (IS_ERR(phydev)) {
netdev_err(dev, "could not attach PHY\n");
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 3485011..3b803f2 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1218,7 +1218,7 @@ static int greth_mdio_reset(struct mii_bus *bus)
return 0;
}
-static void greth_link_change(struct net_device *dev)
+static void greth_link_change(struct net_device *dev, void *context)
{
struct greth_private *greth = netdev_priv(dev);
struct phy_device *phydev = greth->phy;
@@ -1289,7 +1289,8 @@ static int greth_mdio_probe(struct net_device *dev)
ret = phy_connect_direct(dev, phy, &greth_link_change,
0, greth->gbit_mac ?
PHY_INTERFACE_MODE_GMII :
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII.
+ NULL);
if (ret) {
if (netif_msg_ifup(greth))
dev_err(&dev->dev, "could not attach to PHY\n");
@@ -1363,7 +1364,7 @@ static int greth_mdio_init(struct greth_private *greth)
while (!phy_aneg_done(greth->phy) && time_before(jiffies, timeout)) {
}
genphy_read_status(greth->phy);
- greth_link_change(greth->netdev);
+ greth_link_change(greth->netdev, NULL);
}
return 0;
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 397596b..ed7e60a 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -292,7 +292,7 @@ static void au1000_enable_rx_tx(struct net_device *dev)
}
static void
-au1000_adjust_link(struct net_device *dev)
+au1000_adjust_link(struct net_device *dev, void *context)
{
struct au1000_private *aup = netdev_priv(dev);
struct phy_device *phydev = aup->phy_dev;
@@ -438,7 +438,7 @@ static int au1000_mii_probe(struct net_device *dev)
BUG_ON(phydev->attached_dev);
phydev = phy_connect(dev, dev_name(&phydev->dev), &au1000_adjust_link,
- 0, PHY_INTERFACE_MODE_MII);
+ 0, PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(phydev)) {
netdev_err(dev, "Could not attach to PHY\n");
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index c7ca7ec..84b7033 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -698,7 +698,7 @@ static void bcm_enet_set_flow(struct bcm_enet_priv *priv, int rx_en, int tx_en)
/*
* link changed callback (from phylib)
*/
-static void bcm_enet_adjust_phy_link(struct net_device *dev)
+static void bcm_enet_adjust_phy_link(struct net_device *dev, void *context)
{
struct bcm_enet_priv *priv;
struct phy_device *phydev;
@@ -800,7 +800,7 @@ static int bcm_enet_open(struct net_device *dev)
priv->mii_bus->id, priv->phy_id);
phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(phydev)) {
dev_err(kdev, "could not attach to PHY\n");
diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
index 49e7a25..58155d3 100644
--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
+++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
@@ -316,7 +316,7 @@ static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int sbmac_close(struct net_device *dev);
static int sbmac_poll(struct napi_struct *napi, int budget);
-static void sbmac_mii_poll(struct net_device *dev);
+static void sbmac_mii_poll(struct net_device *dev, void *context);
static int sbmac_mii_probe(struct net_device *dev);
static void sbmac_mii_sync(void __iomem *sbm_mdio);
@@ -2386,7 +2386,7 @@ static int sbmac_mii_probe(struct net_device *dev)
}
phy_dev = phy_connect(dev, dev_name(&phy_dev->dev), &sbmac_mii_poll, 0,
- PHY_INTERFACE_MODE_GMII);
+ PHY_INTERFACE_MODE_GMII, NULL);
if (IS_ERR(phy_dev)) {
printk(KERN_ERR "%s: could not attach to PHY\n", dev->name);
return PTR_ERR(phy_dev);
@@ -2415,7 +2415,7 @@ static int sbmac_mii_probe(struct net_device *dev)
}
-static void sbmac_mii_poll(struct net_device *dev)
+static void sbmac_mii_poll(struct net_device *dev, void *context)
{
struct sbmac_softc *sc = netdev_priv(dev);
struct phy_device *phy_dev = sc->phy_dev;
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index e47ff8b..2130a76 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -1756,7 +1756,7 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 lcladv, u32 rmtadv)
tw32_f(MAC_TX_MODE, tp->tx_mode);
}
-static void tg3_adjust_link(struct net_device *dev)
+static void tg3_adjust_link(struct net_device *dev, void *context)
{
u8 oldflowctrl, linkmesg = 0;
u32 mac_mode, lcl_adv, rmt_adv;
@@ -1854,7 +1854,7 @@ static int tg3_phy_init(struct tg3 *tp)
/* Attach the MAC to the PHY. */
phydev = phy_connect(tp->dev, dev_name(&phydev->dev), tg3_adjust_link,
- phydev->dev_flags, phydev->interface);
+ phydev->dev_flags, phydev->interface, NULL);
if (IS_ERR(phydev)) {
dev_err(&tp->pdev->dev, "Could not attach to PHY\n");
return PTR_ERR(phydev);
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 1466bc4..943833c 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -135,7 +135,7 @@ static int macb_mdio_reset(struct mii_bus *bus)
return 0;
}
-static void macb_handle_link_change(struct net_device *dev)
+static void macb_handle_link_change(struct net_device *dev, void *context)
{
struct macb *bp = netdev_priv(dev);
struct phy_device *phydev = bp->phy_dev;
@@ -206,7 +206,7 @@ static int macb_mii_probe(struct net_device *dev)
/* attach the mac to the phy */
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, 0,
- bp->phy_interface);
+ bp->phy_interface, NULL);
if (ret) {
netdev_err(dev, "Could not attach to PHY\n");
return ret;
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index 290b26f..68bc305 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -176,7 +176,7 @@ static int dnet_mdio_reset(struct mii_bus *bus)
return 0;
}
-static void dnet_handle_link_change(struct net_device *dev)
+static void dnet_handle_link_change(struct net_device *dev, void *context)
{
struct dnet *bp = netdev_priv(dev);
struct phy_device *phydev = bp->phy_dev;
@@ -282,11 +282,11 @@ static int dnet_mii_probe(struct net_device *dev)
if (bp->capabilities & DNET_HAS_RMII) {
phydev = phy_connect(dev, dev_name(&phydev->dev),
&dnet_handle_link_change, 0,
- PHY_INTERFACE_MODE_RMII);
+ PHY_INTERFACE_MODE_RMII, NULL);
} else {
phydev = phy_connect(dev, dev_name(&phydev->dev),
&dnet_handle_link_change, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
}
if (IS_ERR(phydev)) {
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index a381678..dd33a50 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -661,7 +661,7 @@ static int ethoc_mdio_reset(struct mii_bus *bus)
return 0;
}
-static void ethoc_mdio_poll(struct net_device *dev)
+static void ethoc_mdio_poll(struct net_device *dev, void *context)
{
}
@@ -683,7 +683,7 @@ static int __devinit ethoc_mdio_probe(struct net_device *dev)
}
err = phy_connect_direct(dev, phy, ethoc_mdio_poll, 0,
- PHY_INTERFACE_MODE_GMII);
+ PHY_INTERFACE_MODE_GMII, NULL);
if (err) {
dev_err(&dev->dev, "could not attach to PHY\n");
return err;
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 16b0704..79c5502 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -803,7 +803,7 @@ err:
/******************************************************************************
* internal functions (mdio)
*****************************************************************************/
-static void ftgmac100_adjust_link(struct net_device *netdev)
+static void ftgmac100_adjust_link(struct net_device *netdev, void *context)
{
struct ftgmac100 *priv = netdev_priv(netdev);
struct phy_device *phydev = priv->phydev;
@@ -854,7 +854,7 @@ static int ftgmac100_mii_probe(struct ftgmac100 *priv)
phydev = phy_connect(netdev, dev_name(&phydev->dev),
&ftgmac100_adjust_link, 0,
- PHY_INTERFACE_MODE_GMII);
+ PHY_INTERFACE_MODE_GMII, NULL);
if (IS_ERR(phydev)) {
netdev_err(netdev, "%s: Could not attach to PHY\n", netdev->name);
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index ff7f4c5..b0b5adc 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -856,7 +856,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
/*
* Phy section
*/
-static void fec_enet_adjust_link(struct net_device *ndev)
+static void fec_enet_adjust_link(struct net_device *ndev, void *context)
{
struct fec_enet_private *fep = netdev_priv(ndev);
struct phy_device *phy_dev = fep->phy_dev;
@@ -994,7 +994,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
snprintf(phy_name, sizeof(phy_name), PHY_ID_FMT, mdio_bus_id, phy_id);
phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0,
- fep->phy_interface);
+ fep->phy_interface, NULL);
if (IS_ERR(phy_dev)) {
printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name);
return PTR_ERR(phy_dev);
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
index 2933d08..800b7fb 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
@@ -172,7 +172,7 @@ static int mpc52xx_fec_alloc_rx_buffers(struct net_device *dev, struct bcom_task
}
/* based on generic_adjust_link from fs_enet-main.c */
-static void mpc52xx_fec_adjust_link(struct net_device *dev)
+static void mpc52xx_fec_adjust_link(struct net_device *dev, void *context)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct phy_device *phydev = priv->phydev;
@@ -229,7 +229,8 @@ static int mpc52xx_fec_open(struct net_device *dev)
if (priv->phy_node) {
priv->phydev = of_phy_connect(priv->ndev, priv->phy_node,
- mpc52xx_fec_adjust_link, 0, 0);
+ mpc52xx_fec_adjust_link,
+ 0, 0, NULL);
if (!priv->phydev) {
dev_err(&dev->dev, "of_phy_connect failed\n");
return -ENODEV;
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 2b7633f..82a1dcd 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -771,7 +771,7 @@ static void generic_adjust_link(struct net_device *dev)
}
-static void fs_adjust_link(struct net_device *dev)
+static void fs_adjust_link(struct net_device *dev, void *context)
{
struct fs_enet_private *fep = netdev_priv(dev);
unsigned long flags;
@@ -800,10 +800,10 @@ static int fs_init_phy(struct net_device *dev)
PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII;
phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
- iface);
+ iface, NULL);
if (!phydev) {
phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
- iface);
+ iface, NULL);
}
if (!phydev) {
dev_err(&dev->dev, "Could not attach to PHY\n");
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index f2db8fc..4d3324a 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -120,7 +120,7 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu);
static irqreturn_t gfar_error(int irq, void *dev_id);
static irqreturn_t gfar_transmit(int irq, void *dev_id);
static irqreturn_t gfar_interrupt(int irq, void *dev_id);
-static void adjust_link(struct net_device *dev);
+static void adjust_link(struct net_device *dev, void *context);
static void init_registers(struct net_device *dev);
static int init_phy(struct net_device *dev);
static int gfar_probe(struct platform_device *ofdev);
@@ -1434,10 +1434,10 @@ static int init_phy(struct net_device *dev)
interface = gfar_get_interface(dev);
priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
- interface);
+ interface, NULL);
if (!priv->phydev)
priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
- interface);
+ interface, NULL);
if (!priv->phydev) {
dev_err(&dev->dev, "could not attach to PHY\n");
return -ENODEV;
@@ -2939,7 +2939,7 @@ static irqreturn_t gfar_interrupt(int irq, void *grp_id)
* function converts those variables into the appropriate
* register values, and can bring down the device if needed.
*/
-static void adjust_link(struct net_device *dev)
+static void adjust_link(struct net_device *dev, void *context)
{
struct gfar_private *priv = netdev_priv(dev);
struct gfar __iomem *regs = priv->gfargrp[0].regs;
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 9ac14f8..7c79cb5 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -1598,7 +1598,7 @@ static void ugeth_activate(struct ucc_geth_private *ugeth)
* register values, and can bring down the device if needed.
*/
-static void adjust_link(struct net_device *dev)
+static void adjust_link(struct net_device *dev, void *context)
{
struct ucc_geth_private *ugeth = netdev_priv(dev);
struct ucc_geth __iomem *ug_regs;
@@ -1749,10 +1749,10 @@ static int init_phy(struct net_device *dev)
priv->oldduplex = -1;
phydev = of_phy_connect(dev, ug_info->phy_node, &adjust_link, 0,
- priv->phy_interface);
+ priv->phy_interface, NULL);
if (!phydev)
phydev = of_phy_connect_fixed_link(dev, &adjust_link,
- priv->phy_interface);
+ priv->phy_interface, NULL);
if (!phydev) {
dev_err(&dev->dev, "Could not attach to PHY\n");
return -ENODEV;
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 5dc9cbd..07bca02 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -370,7 +370,7 @@ ltq_etop_mdio_rd(struct mii_bus *bus, int phy_addr, int phy_reg)
}
static void
-ltq_etop_mdio_link(struct net_device *dev)
+ltq_etop_mdio_link(struct net_device *dev, void *context)
{
/* nothing to do */
}
@@ -395,7 +395,7 @@ ltq_etop_mdio_probe(struct net_device *dev)
}
phydev = phy_connect(dev, dev_name(&phydev->dev), <q_etop_mdio_link,
- 0, priv->pldata->mii_mode);
+ 0, priv->pldata->mii_mode, NULL);
if (IS_ERR(phydev)) {
netdev_err(dev, "Could not attach to PHY\n");
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 083d671..ed37ead 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -767,7 +767,7 @@ static int lpc_mdio_reset(struct mii_bus *bus)
return __lpc_mii_mngt_reset((struct netdata_local *)bus->priv);
}
-static void lpc_handle_link_change(struct net_device *ndev)
+static void lpc_handle_link_change(struct net_device *ndev, void *context)
{
struct netdata_local *pldat = netdev_priv(ndev);
struct phy_device *phydev = pldat->phy_dev;
@@ -819,7 +819,8 @@ static int lpc_mii_probe(struct net_device *ndev)
netdev_info(ndev, "using RMII interface\n");
phydev = phy_connect(ndev, dev_name(&phydev->dev),
&lpc_handle_link_change, 0,
- lpc_phy_interface_mode(&pldat->pdev->dev));
+ lpc_phy_interface_mode(&pldat->pdev->dev),
+ NULL);
if (IS_ERR(phydev)) {
netdev_err(ndev, "Could not attach to PHY\n");
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index cd827ff..9fdca60 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -626,7 +626,7 @@ static int octeon_mgmt_ioctl(struct net_device *netdev,
return phy_mii_ioctl(p->phydev, rq, cmd);
}
-static void octeon_mgmt_adjust_link(struct net_device *netdev)
+static void octeon_mgmt_adjust_link(struct net_device *netdev, void *context)
{
struct octeon_mgmt *p = netdev_priv(netdev);
int port = p->port;
@@ -681,7 +681,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);
p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(p->phydev)) {
p->phydev = NULL;
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index e559dfa..9aba6b4 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -1021,7 +1021,7 @@ static irqreturn_t pasemi_mac_tx_intr(int irq, void *data)
return IRQ_HANDLED;
}
-static void pasemi_adjust_link(struct net_device *dev)
+static void pasemi_adjust_link(struct net_device *dev, void *context)
{
struct pasemi_mac *mac = netdev_priv(dev);
int msg;
@@ -1099,7 +1099,7 @@ static int pasemi_mac_phy_init(struct net_device *dev)
mac->duplex = -1;
phydev = of_phy_connect(dev, phy_dn, &pasemi_adjust_link, 0,
- PHY_INTERFACE_MODE_SGMII);
+ PHY_INTERFACE_MODE_SGMII, NULL);
if (IS_ERR(phydev)) {
printk(KERN_ERR "%s: Could not attach to phy\n", dev->name);
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index d1827e8..c2f3e53 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -1000,7 +1000,7 @@ static const struct net_device_ops r6040_netdev_ops = {
#endif
};
-static void r6040_adjust_link(struct net_device *dev)
+static void r6040_adjust_link(struct net_device *dev, void *context)
{
struct r6040_private *lp = netdev_priv(dev);
struct phy_device *phydev = lp->phydev;
@@ -1045,7 +1045,7 @@ static int r6040_mii_probe(struct net_device *dev)
}
phydev = phy_connect(dev, dev_name(&phydev->dev), &r6040_adjust_link,
- 0, PHY_INTERFACE_MODE_MII);
+ 0, PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(phydev)) {
dev_err(&lp->pdev->dev, "could not attach to PHY\n");
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 79bf09b..eb089e6 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1302,7 +1302,7 @@ static void sh_eth_timer(unsigned long data)
}
/* PHY state control function */
-static void sh_eth_adjust_link(struct net_device *ndev)
+static void sh_eth_adjust_link(struct net_device *ndev, void *context)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
struct phy_device *phydev = mdp->phydev;
@@ -1355,7 +1355,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
/* Try connect to PHY */
phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link,
- 0, mdp->phy_interface);
+ 0, mdp->phy_interface, NULL);
if (IS_ERR(phydev)) {
dev_err(&ndev->dev, "phy_connect failed\n");
return PTR_ERR(phydev);
diff --git a/drivers/net/ethernet/s6gmac.c b/drivers/net/ethernet/s6gmac.c
index 2ed3ab4..d882267 100644
--- a/drivers/net/ethernet/s6gmac.c
+++ b/drivers/net/ethernet/s6gmac.c
@@ -739,7 +739,7 @@ static inline void s6gmac_linkisup(struct net_device *dev, int isup)
phy_print_status(phydev);
}
-static void s6gmac_adjust_link(struct net_device *dev)
+static void s6gmac_adjust_link(struct net_device *dev, void *context)
{
struct s6gmac *pd = netdev_priv(dev);
struct phy_device *phydev = pd->phydev;
@@ -796,7 +796,7 @@ static inline int s6gmac_phy_start(struct net_device *dev)
while ((i < PHY_MAX_ADDR) && (!(p = pd->mii.bus->phy_map[i])))
i++;
p = phy_connect(dev, dev_name(&p->dev), &s6gmac_adjust_link, 0,
- PHY_INTERFACE_MODE_RGMII);
+ PHY_INTERFACE_MODE_RGMII, NULL);
if (IS_ERR(p)) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(p);
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 1466e5d..1221e242 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -916,7 +916,7 @@ static void smsc911x_phy_update_flowcontrol(struct smsc911x_data *pdata)
/* Update link mode if anything has changed. Called periodically when the
* PHY is in polling mode, even if nothing has changed. */
-static void smsc911x_phy_adjust_link(struct net_device *dev)
+static void smsc911x_phy_adjust_link(struct net_device *dev, void *context)
{
struct smsc911x_data *pdata = netdev_priv(dev);
struct phy_device *phy_dev = pdata->phy_dev;
@@ -999,7 +999,7 @@ static int smsc911x_mii_probe(struct net_device *dev)
ret = phy_connect_direct(dev, phydev,
&smsc911x_phy_adjust_link, 0,
- pdata->config.phy_interface);
+ pdata->config.phy_interface, NULL);
if (ret) {
netdev_err(dev, "Could not attach to PHY\n");
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c
index fd33b21..40e727b 100644
--- a/drivers/net/ethernet/smsc/smsc9420.c
+++ b/drivers/net/ethernet/smsc/smsc9420.c
@@ -1130,7 +1130,7 @@ static void smsc9420_phy_update_flowcontrol(struct smsc9420_pdata *pd)
/* Update link mode if anything has changed. Called periodically when the
* PHY is in polling mode, even if nothing has changed. */
-static void smsc9420_phy_adjust_link(struct net_device *dev)
+static void smsc9420_phy_adjust_link(struct net_device *dev, void *context)
{
struct smsc9420_pdata *pd = netdev_priv(dev);
struct phy_device *phy_dev = pd->phy_dev;
@@ -1179,7 +1179,8 @@ static int smsc9420_mii_probe(struct net_device *dev)
phydev->phy_id);
phydev = phy_connect(dev, dev_name(&phydev->dev),
- smsc9420_phy_adjust_link, 0, PHY_INTERFACE_MODE_MII);
+ smsc9420_phy_adjust_link, 0,
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(phydev)) {
pr_err("%s: Could not attach to PHY\n", dev->name);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 51b3b68..431f9b0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -232,9 +232,10 @@ static inline void stmmac_hw_fix_mac_speed(struct stmmac_priv *priv)
/**
* stmmac_adjust_link
* @dev: net device structure
+ * @context: context callback structure
* Description: it adjusts the link parameters.
*/
-static void stmmac_adjust_link(struct net_device *dev)
+static void stmmac_adjust_link(struct net_device *dev, void *context)
{
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phydev = priv->phydev;
@@ -350,7 +351,8 @@ static int stmmac_init_phy(struct net_device *dev)
priv->plat->phy_addr);
pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id);
- phydev = phy_connect(dev, phy_id, &stmmac_adjust_link, 0, interface);
+ phydev = phy_connect(dev, phy_id, &stmmac_adjust_link,
+ 0, interface, NULL);
if (IS_ERR(phydev)) {
pr_err("%s: Could not attach to PHY\n", dev->name);
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 860c252..f2cddc1 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -920,7 +920,7 @@ static const struct ethtool_ops cpmac_ethtool_ops = {
.set_ringparam = cpmac_set_ringparam,
};
-static void cpmac_adjust_link(struct net_device *dev)
+static void cpmac_adjust_link(struct net_device *dev, void *context)
{
struct cpmac_priv *priv = netdev_priv(dev);
int new_state = 0;
@@ -1174,7 +1174,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
mdio_bus_id, phy_id);
priv->phy = phy_connect(dev, priv->phy_name, cpmac_adjust_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(priv->phy)) {
if (netif_msg_drv(priv))
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 6685bbb..5c97725 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -398,7 +398,7 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,
slave->mac_control = mac_control;
}
-static void cpsw_adjust_link(struct net_device *ndev)
+static void cpsw_adjust_link(struct net_device *ndev, void *context)
{
struct cpsw_priv *priv = netdev_priv(ndev);
bool link = false;
@@ -451,7 +451,8 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
1 << slave_port, 0, ALE_MCAST_FWD_2);
slave->phy = phy_connect(priv->ndev, slave->data->phy_id,
- &cpsw_adjust_link, 0, slave->data->phy_if);
+ &cpsw_adjust_link, 0,
+ slave->data->phy_if, NULL);
if (IS_ERR(slave->phy)) {
dev_err(priv->dev, "phy %s not found on slave %d\n",
slave->data->phy_id, slave->slave_num);
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 4da93a5..a902a2d 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1446,7 +1446,7 @@ void emac_poll_controller(struct net_device *ndev)
}
#endif
-static void emac_adjust_link(struct net_device *ndev)
+static void emac_adjust_link(struct net_device *ndev, void *context)
{
struct emac_priv *priv = netdev_priv(ndev);
struct phy_device *phydev = priv->phydev;
@@ -1597,7 +1597,7 @@ static int emac_dev_open(struct net_device *ndev)
if (priv->phy_id && *priv->phy_id) {
priv->phydev = phy_connect(ndev, priv->phy_id,
&emac_adjust_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(priv->phydev)) {
dev_err(emac_dev, "could not connect to phy %s\n",
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c
index 651a70c..ef21735 100644
--- a/drivers/net/ethernet/toshiba/tc35815.c
+++ b/drivers/net/ethernet/toshiba/tc35815.c
@@ -537,7 +537,7 @@ static int tc_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 val)
return 0;
}
-static void tc_handle_link_change(struct net_device *dev)
+static void tc_handle_link_change(struct net_device *dev, void *context)
{
struct tc35815_local *lp = netdev_priv(dev);
struct phy_device *phydev = lp->phy_dev;
@@ -635,7 +635,8 @@ static int tc_mii_probe(struct net_device *dev)
phydev = phy_connect(dev, dev_name(&phydev->dev),
&tc_handle_link_change, 0,
lp->chiptype == TC35815_TX4939 ?
- PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_RMII : PHY_INTERFACE_MODE_MII,
+ NULL);
if (IS_ERR(phydev)) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 1eaf712..97e2d77 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -590,7 +590,7 @@ static void temac_device_reset(struct net_device *ndev)
ndev->trans_start = jiffies; /* prevent tx timeout */
}
-void temac_adjust_link(struct net_device *ndev)
+void temac_adjust_link(struct net_device *ndev, void *context)
{
struct temac_local *lp = netdev_priv(ndev);
struct phy_device *phy = lp->phy_dev;
@@ -857,7 +857,7 @@ static int temac_open(struct net_device *ndev)
if (lp->phy_node) {
lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node,
- temac_adjust_link, 0, 0);
+ temac_adjust_link, 0, 0, NULL);
if (!lp->phy_dev) {
dev_err(lp->dev, "of_phy_connect() failed\n");
return -ENODEV;
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 9c365e1..d69ae3c 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -522,6 +522,7 @@ static void axienet_device_reset(struct net_device *ndev)
/**
* axienet_adjust_link - Adjust the PHY link speed/duplex.
* @ndev: Pointer to the net_device structure
+ * @context: Pointer to the context argument
*
* This function is called to change the speed and duplex setting after
* auto negotiation is done by the PHY. This is the function that gets
@@ -934,7 +935,7 @@ static int axienet_open(struct net_device *ndev)
if (lp->phy_node) {
lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node,
axienet_adjust_link, 0,
- PHY_INTERFACE_MODE_GMII);
+ PHY_INTERFACE_MODE_GMII, NULL);
if (!lp->phy_dev) {
dev_err(lp->dev, "of_phy_connect() failed\n");
return -ENODEV;
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 77cfe51..eb641aa 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -892,11 +892,12 @@ err_register:
/**
* xemaclite_adjust_link - Link state callback for the Emaclite device
* @ndev: pointer to net_device struct
+ * @context: pointer to context argument
*
* There's nothing in the Emaclite device to be configured when the link
* state changes. We just print the status.
*/
-void xemaclite_adjust_link(struct net_device *ndev)
+void xemaclite_adjust_link(struct net_device *ndev, void *context)
{
struct net_local *lp = netdev_priv(ndev);
struct phy_device *phy = lp->phy_dev;
@@ -932,7 +933,7 @@ static int xemaclite_open(struct net_device *dev)
lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node,
xemaclite_adjust_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (!lp->phy_dev) {
dev_err(&lp->ndev->dev, "of_phy_connect() failed\n");
return -ENODEV;
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 482648f..5c39324 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -543,7 +543,7 @@ static void ixp4xx_mdio_remove(void)
}
-static void ixp4xx_adjust_link(struct net_device *dev)
+static void ixp4xx_adjust_link(struct net_device *dev, void *context)
{
struct port *port = netdev_priv(dev);
struct phy_device *phydev = port->phydev;
@@ -1448,7 +1448,7 @@ static int __devinit eth_init_one(struct platform_device *pdev)
snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
mdio_bus->id, plat->phy);
port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
- PHY_INTERFACE_MODE_MII);
+ PHY_INTERFACE_MODE_MII, NULL);
if (IS_ERR(port->phydev)) {
err = PTR_ERR(port->phydev);
goto err_free_mem;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] of/mdio: add context argument to adjust link callback
From: s-paulraj @ 2012-07-06 20:09 UTC (permalink / raw)
To: netdev, davem, cyril, grant.likely, linux-keystone; +Cc: Sandeep Paulraj
From: Sandeep Paulraj <s-paulraj@ti.com>
This patch implements extensions to device-tree phy interfaces in order to
have context information passed back into the adjust link callbacks.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
drivers/of/of_mdio.c | 24 +++++++++++++++---------
include/linux/of_mdio.h | 15 ++++++++-------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 2574abd..a0a09db 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -136,20 +136,24 @@ EXPORT_SYMBOL(of_phy_find_device);
* @phy_np: Pointer to device tree node for the PHY
* @hndlr: Link state callback for the network device
* @iface: PHY data interface type
+ * @context: Context for callback handler
*
* Returns a pointer to the phy_device if successful. NULL otherwise
*/
-struct phy_device *of_phy_connect(struct net_device *dev,
- struct device_node *phy_np,
- void (*hndlr)(struct net_device *), u32 flags,
- phy_interface_t iface)
+struct phy_device *
+of_phy_connect(struct net_device *dev,
+ struct device_node *phy_np,
+ void (*hndlr)(struct net_device *, void *context),
+ u32 flags, phy_interface_t iface, void *context)
{
struct phy_device *phy = of_phy_find_device(phy_np);
+ int error;
if (!phy)
return NULL;
- return phy_connect_direct(dev, phy, hndlr, flags, iface) ? NULL : phy;
+ error = phy_connect_direct(dev, phy, hndlr, flags, iface, context);
+ return error ? NULL : phy;
}
EXPORT_SYMBOL(of_phy_connect);
@@ -158,14 +162,16 @@ EXPORT_SYMBOL(of_phy_connect);
* @dev: pointer to net_device claiming the phy
* @hndlr: Link state callback for the network device
* @iface: PHY data interface type
+ * @context: Context for callback handler
*
* This function is a temporary stop-gap and will be removed soon. It is
* only to support the fs_enet, ucc_geth and gianfar Ethernet drivers. Do
* not call this function from new drivers.
*/
-struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
- void (*hndlr)(struct net_device *),
- phy_interface_t iface)
+struct phy_device *
+of_phy_connect_fixed_link(struct net_device *dev,
+ void (*hndlr)(struct net_device *, void *context),
+ phy_interface_t iface, void *context)
{
struct device_node *net_np;
char bus_id[MII_BUS_ID_SIZE + 3];
@@ -186,7 +192,7 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
sprintf(bus_id, PHY_ID_FMT, "fixed-0", be32_to_cpu(phy_id[0]));
- phy = phy_connect(dev, bus_id, hndlr, 0, iface);
+ phy = phy_connect(dev, bus_id, hndlr, 0, iface, context);
return IS_ERR(phy) ? NULL : phy;
}
EXPORT_SYMBOL(of_phy_connect_fixed_link);
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 912c27a..d72d0c6 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -14,13 +14,14 @@
extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
-extern struct phy_device *of_phy_connect(struct net_device *dev,
- struct device_node *phy_np,
- void (*hndlr)(struct net_device *),
- u32 flags, phy_interface_t iface);
-extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
- void (*hndlr)(struct net_device *),
- phy_interface_t iface);
+extern struct phy_device *
+of_phy_connect(struct net_device *dev, struct device_node *phy_np,
+ void (*hndlr)(struct net_device *, void *context),
+ u32 flags, phy_interface_t iface, void *context);
+extern struct phy_device *
+of_phy_connect_fixed_link(struct net_device *dev,
+ void (*hndlr)(struct net_device *, void *context),
+ phy_interface_t iface, void *context);
extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/4] phylib: add context argument to adjust link callback
From: s-paulraj @ 2012-07-06 20:09 UTC (permalink / raw)
To: netdev, davem, cyril, grant.likely, linux-keystone; +Cc: Sandeep Paulraj
From: Sandeep Paulraj <s-paulraj@ti.com>
This patch introduces a context argument for the adjust link callback. This
context information is set at phy_connect() (and its variants), and is passed
back into the adjust_link callbacks on link state change events.
Such context information is necessary when a network device has multiple
underlying ports. Specifically, this comes into play when the netdev is
really one of the ports going into an on-chip switch of some sort.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
drivers/net/phy/phy.c | 6 +++---
drivers/net/phy/phy_device.c | 23 +++++++++++++++--------
include/linux/phy.h | 20 ++++++++++++--------
3 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 36ca912..491a608 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -433,7 +433,7 @@ static void phy_change(struct work_struct *work);
* function.
*/
void phy_start_machine(struct phy_device *phydev,
- void (*handler)(struct net_device *))
+ void (*handler)(struct net_device *, void *context))
{
phydev->adjust_state = handler;
@@ -763,7 +763,7 @@ EXPORT_SYMBOL(phy_start);
static inline void phy_adjust_link(struct phy_device *phydev)
{
- phydev->adjust_link(phydev->attached_dev);
+ phydev->adjust_link(phydev->attached_dev, phydev->context);
}
/**
@@ -781,7 +781,7 @@ void phy_state_machine(struct work_struct *work)
mutex_lock(&phydev->lock);
if (phydev->adjust_state)
- phydev->adjust_state(phydev->attached_dev);
+ phydev->adjust_state(phydev->attached_dev, phydev->context);
switch(phydev->state) {
case PHY_DOWN:
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index de86a55..a4e5313 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -310,6 +310,7 @@ EXPORT_SYMBOL(phy_find_first);
* phy_prepare_link - prepares the PHY layer to monitor link status
* @phydev: target phy_device struct
* @handler: callback function for link status change notifications
+ * @context: context information for callback handler
*
* Description: Tells the PHY infrastructure to handle the
* gory details on monitoring link status (whether through
@@ -319,9 +320,11 @@ EXPORT_SYMBOL(phy_find_first);
* this function.
*/
static void phy_prepare_link(struct phy_device *phydev,
- void (*handler)(struct net_device *))
+ void (*handler)(struct net_device *, void *context),
+ void *context)
{
phydev->adjust_link = handler;
+ phydev->context = context;
}
/**
@@ -331,10 +334,11 @@ static void phy_prepare_link(struct phy_device *phydev,
* @handler: callback function for state change notifications
* @flags: PHY device's dev_flags
* @interface: PHY device's interface
+ * @context: context information for callback handler
*/
int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
- void (*handler)(struct net_device *), u32 flags,
- phy_interface_t interface)
+ void (*handler)(struct net_device *, void *context),
+ u32 flags, phy_interface_t interface, void *context)
{
int rc;
@@ -342,7 +346,7 @@ int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
if (rc)
return rc;
- phy_prepare_link(phydev, handler);
+ phy_prepare_link(phydev, handler, context);
phy_start_machine(phydev, NULL);
if (phydev->irq > 0)
phy_start_interrupts(phydev);
@@ -358,6 +362,7 @@ EXPORT_SYMBOL(phy_connect_direct);
* @handler: callback function for state change notifications
* @flags: PHY device's dev_flags
* @interface: PHY device's interface
+ * @context: context information for callback handler
*
* Description: Convenience function for connecting ethernet
* devices to PHY devices. The default behavior is for
@@ -367,9 +372,10 @@ EXPORT_SYMBOL(phy_connect_direct);
* choose to call only the subset of functions which provide
* the desired functionality.
*/
-struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
- void (*handler)(struct net_device *), u32 flags,
- phy_interface_t interface)
+struct phy_device *
+phy_connect(struct net_device *dev, const char *bus_id,
+ void (*handler)(struct net_device *, void *context),
+ u32 flags, phy_interface_t interface, void *context)
{
struct phy_device *phydev;
struct device *d;
@@ -384,7 +390,8 @@ struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
}
phydev = to_phy_device(d);
- rc = phy_connect_direct(dev, phydev, handler, flags, interface);
+ rc = phy_connect_direct(dev, phydev, handler, flags, interface,
+ context);
if (rc)
return ERR_PTR(rc);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index c291cae..596b8fe 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -263,6 +263,7 @@ enum phy_state {
* changes in the link state.
* adjust_state: Callback for the enet driver to respond to
* changes in the state machine.
+ * context: Context information for adjust_link and adjust_state callbacks
*
* speed, duplex, pause, supported, advertising, and
* autoneg are used like in mii_if_info
@@ -337,9 +338,11 @@ struct phy_device {
struct net_device *attached_dev;
- void (*adjust_link)(struct net_device *dev);
+ void (*adjust_link)(struct net_device *dev, void *context);
- void (*adjust_state)(struct net_device *dev);
+ void (*adjust_state)(struct net_device *dev, void *context);
+
+ void *context;
};
#define to_phy_device(d) container_of(d, struct phy_device, dev)
@@ -487,11 +490,12 @@ 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);
int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
- void (*handler)(struct net_device *), u32 flags,
- phy_interface_t interface);
-struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
- void (*handler)(struct net_device *), u32 flags,
- phy_interface_t interface);
+ void (*handler)(struct net_device *, void *context),
+ u32 flags, phy_interface_t interface, void *context);
+struct phy_device *
+phy_connect(struct net_device *dev, const char *bus_id,
+ void (*handler)(struct net_device *, void *context),
+ u32 flags, phy_interface_t interface, void *context);
void phy_disconnect(struct phy_device *phydev);
void phy_detach(struct phy_device *phydev);
void phy_start(struct phy_device *phydev);
@@ -514,7 +518,7 @@ void phy_driver_unregister(struct phy_driver *drv);
int phy_driver_register(struct phy_driver *new_driver);
void phy_state_machine(struct work_struct *work);
void phy_start_machine(struct phy_device *phydev,
- void (*handler)(struct net_device *));
+ void (*handler)(struct net_device *, void *context));
void phy_stop_machine(struct phy_device *phydev);
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/4] phylib: factor out handler callouts into helper
From: s-paulraj @ 2012-07-06 20:09 UTC (permalink / raw)
To: netdev, davem, cyril, grant.likely, linux-keystone; +Cc: Sandeep Paulraj
From: Sandeep Paulraj <s-paulraj@ti.com>
This patch pulls out adjust_link handler callbacks into a helper function.
The patch does not modify phylib behavior in any material way.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
drivers/net/phy/phy.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3cbda08..36ca912 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -761,6 +761,11 @@ void phy_start(struct phy_device *phydev)
EXPORT_SYMBOL(phy_stop);
EXPORT_SYMBOL(phy_start);
+static inline void phy_adjust_link(struct phy_device *phydev)
+{
+ phydev->adjust_link(phydev->attached_dev);
+}
+
/**
* phy_state_machine - Handle the state machine
* @work: work_struct that describes the work to be done
@@ -801,7 +806,7 @@ void phy_state_machine(struct work_struct *work)
if (!phydev->link) {
phydev->state = PHY_NOLINK;
netif_carrier_off(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
break;
}
@@ -815,7 +820,7 @@ void phy_state_machine(struct work_struct *work)
if (err > 0) {
phydev->state = PHY_RUNNING;
netif_carrier_on(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
} else if (0 == phydev->link_timeout--) {
int idx;
@@ -853,7 +858,7 @@ void phy_state_machine(struct work_struct *work)
if (phydev->link) {
phydev->state = PHY_RUNNING;
netif_carrier_on(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
}
break;
case PHY_FORCING:
@@ -872,7 +877,7 @@ void phy_state_machine(struct work_struct *work)
}
}
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
break;
case PHY_RUNNING:
/* Only register a CHANGE if we are
@@ -894,7 +899,7 @@ void phy_state_machine(struct work_struct *work)
netif_carrier_off(phydev->attached_dev);
}
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
if (PHY_POLL != phydev->irq)
err = phy_config_interrupt(phydev,
@@ -904,7 +909,7 @@ void phy_state_machine(struct work_struct *work)
if (phydev->link) {
phydev->link = 0;
netif_carrier_off(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
}
break;
case PHY_RESUMING:
@@ -938,7 +943,7 @@ void phy_state_machine(struct work_struct *work)
netif_carrier_on(phydev->attached_dev);
} else
phydev->state = PHY_NOLINK;
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
} else {
phydev->state = PHY_AN;
phydev->link_timeout = PHY_AN_TIMEOUT;
@@ -953,7 +958,7 @@ void phy_state_machine(struct work_struct *work)
netif_carrier_on(phydev->attached_dev);
} else
phydev->state = PHY_NOLINK;
- phydev->adjust_link(phydev->attached_dev);
+ phy_adjust_link(phydev);
}
break;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/4] phylib: add context argument to adjust link callbacks
From: s-paulraj @ 2012-07-06 19:57 UTC (permalink / raw)
To: netdev, davem, cyril, grant.likely, linux-keystone; +Cc: Sandeep Paulraj
From: Sandeep Paulraj <s-paulraj@ti.com>
This series of 4 patches adds a new context argument for the adjust link
callbacks. The existing phy_connect() and its variants don't have a way to
pass any private context information. This becomes necessary when, a SOC
has an on chip switch with multiple ports. We need port specific information
to figure out which port a given callback belongs to.
We can pass this context information in the phy_connect() and its
variants. This in turn gets passed into the adjust link callbacks on link
state change events.
NOTE: At this point of time patch 4 in this series passes a "NULL" to
the phy_connect() and its variants for all drivers that currently use
phy_connect() and its variants. This patch has been tested on a
Texas Instruments SOC, patches for which, as of now have not yet been
upstreamed; as a result of which this patch series does not yet
have an example of how this new feature is being actually used.
Sandeep Paulraj (4):
phylib: factor out handler callouts into helper
phylib: add context argument to adjust link callback
of/mdio: add context argument to adjust link callback
net: add context callback parameter to phy connect
drivers/net/ethernet/8390/ax88796.c | 4 ++--
drivers/net/ethernet/adi/bfin_mac.c | 4 ++--
drivers/net/ethernet/aeroflex/greth.c | 7 +++---
drivers/net/ethernet/amd/au1000_eth.c | 4 ++--
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++--
drivers/net/ethernet/broadcom/sb1250-mac.c | 6 ++---
drivers/net/ethernet/broadcom/tg3.c | 4 ++--
drivers/net/ethernet/cadence/macb.c | 4 ++--
drivers/net/ethernet/dnet.c | 6 ++---
drivers/net/ethernet/ethoc.c | 4 ++--
drivers/net/ethernet/faraday/ftgmac100.c | 4 ++--
drivers/net/ethernet/freescale/fec.c | 4 ++--
drivers/net/ethernet/freescale/fec_mpc52xx.c | 5 ++--
.../net/ethernet/freescale/fs_enet/fs_enet-main.c | 6 ++---
drivers/net/ethernet/freescale/gianfar.c | 8 +++----
drivers/net/ethernet/freescale/ucc_geth.c | 6 ++---
drivers/net/ethernet/lantiq_etop.c | 4 ++--
drivers/net/ethernet/nxp/lpc_eth.c | 5 ++--
drivers/net/ethernet/octeon/octeon_mgmt.c | 4 ++--
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
drivers/net/ethernet/rdc/r6040.c | 4 ++--
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
drivers/net/ethernet/s6gmac.c | 4 ++--
drivers/net/ethernet/smsc/smsc911x.c | 4 ++--
drivers/net/ethernet/smsc/smsc9420.c | 5 ++--
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--
drivers/net/ethernet/ti/cpmac.c | 4 ++--
drivers/net/ethernet/ti/cpsw.c | 5 ++--
drivers/net/ethernet/ti/davinci_emac.c | 4 ++--
drivers/net/ethernet/toshiba/tc35815.c | 5 ++--
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 ++-
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 5 ++--
drivers/net/ethernet/xscale/ixp4xx_eth.c | 4 ++--
drivers/net/phy/phy.c | 25 ++++++++++++--------
drivers/net/phy/phy_device.c | 23 +++++++++++-------
drivers/of/of_mdio.c | 24 ++++++++++++-------
include/linux/of_mdio.h | 15 ++++++------
include/linux/phy.h | 20 +++++++++-------
39 files changed, 149 insertions(+), 116 deletions(-)
--
1.7.9.5
^ permalink raw reply
* Re: Network namespace and bonding WARNING at fs/proc/generic.c remove_proc_entry
From: Serge E. Hallyn @ 2012-07-06 19:47 UTC (permalink / raw)
To: Eric W. Biederman
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
Dilip Daya, linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <87fw94g1kq.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Quoting Eric W. Biederman (ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org):
> "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org> writes:
>
> >> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> >> index 2ee8cf9..818ed64 100644
> >> --- a/drivers/net/bonding/bond_main.c
> >> +++ b/drivers/net/bonding/bond_main.c
> >> @@ -4345,6 +4345,9 @@ static void bond_setup(struct net_device *bond_dev)
> >> bond_dev->priv_flags |= IFF_BONDING;
> >> bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
> >>
> >> + /* Don't allow bond devices to change network namespaces. */
> >> + bond_dev->features |= NETIF_F_LOCAL;
> >
> > I believe this needs to be NETIF_F_NETNS_LOCAL. Test build still going with
> > that change.
>
> Yes that is what I mean.
With that change, build is fine, boots fine, I can't pass a bond to another
netns (preventing the problem), and I can create a bond in a child netns
just fine.
Thanks!
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
-serge
^ permalink raw reply
* pull request: wireless 2012-07-06
From: John W. Linville @ 2012-07-06 19:20 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 4387 bytes --]
commit 50787c0dfcffe9be908994bdd7bb28b1a49192b5
Dave,
Please accept these fixes for the 3.5 stream...
Eliad Peller provides a mac80211 fix to properly clean-up after an
association failure.
Sasha Levin offers an NFC fix to prevent a NULL pointer derference
in llcp_sock_getname.
Thomas Huehn provides an mwl8k fix for a race that can result in
a use-after-free bug. Also, he provides a mac80211 fix to correct
some kzalloc arguments, and another fix to address an issue found
with that fix after I had already committed the original patch.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 9e85a6f9dc231f3ed3c1dc1b12217505d970142a:
Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturquette/linux (2012-07-03 18:06:49 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git for-davem
for you to fetch changes up to 50787c0dfcffe9be908994bdd7bb28b1a49192b5:
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem (2012-07-06 14:48:50 -0400)
----------------------------------------------------------------
Eliad Peller (1):
mac80211: destroy assoc_data correctly if assoc fails
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem
Sasha Levin (1):
NFC: Prevent NULL deref when getting socket name
Thomas Huehn (3):
mac80211: correct size the argument to kzalloc in minstrel_ht
mwl8k: fix possible race condition in info->control.sta use
mac80211: fix kzalloc memory corruption introduced in minstrel_ht
drivers/net/wireless/mwl8k.c | 3 ++-
net/mac80211/mlme.c | 6 ++----
net/mac80211/rc80211_minstrel_ht.c | 2 +-
net/nfc/llcp/sock.c | 2 +-
4 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index cf7bdc6..1404373 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1665,7 +1665,8 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
info = IEEE80211_SKB_CB(skb);
if (ieee80211_is_data(wh->frame_control)) {
- sta = info->control.sta;
+ sta = ieee80211_find_sta_by_ifaddr(hw, wh->addr1,
+ wh->addr2);
if (sta) {
sta_info = MWL8K_STA(sta);
BUG_ON(sta_info == NULL);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a4bb856..0db5d34 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2174,15 +2174,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
sdata->name, mgmt->sa, status_code);
ieee80211_destroy_assoc_data(sdata, false);
} else {
- printk(KERN_DEBUG "%s: associated\n", sdata->name);
-
if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) {
/* oops -- internal error -- send timeout for now */
- ieee80211_destroy_assoc_data(sdata, true);
- sta_info_destroy_addr(sdata, mgmt->bssid);
+ ieee80211_destroy_assoc_data(sdata, false);
cfg80211_put_bss(*bss);
return RX_MGMT_CFG80211_ASSOC_TIMEOUT;
}
+ printk(KERN_DEBUG "%s: associated\n", sdata->name);
/*
* destroy assoc_data afterwards, as otherwise an idle
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 2d1acc6..f9e51ef 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -809,7 +809,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
max_rates = sband->n_bitrates;
}
- msp = kzalloc(sizeof(struct minstrel_ht_sta), gfp);
+ msp = kzalloc(sizeof(*msp), gfp);
if (!msp)
return NULL;
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c
index 17a707d..e06d458 100644
--- a/net/nfc/llcp/sock.c
+++ b/net/nfc/llcp/sock.c
@@ -292,7 +292,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *addr,
pr_debug("%p\n", sk);
- if (llcp_sock == NULL)
+ if (llcp_sock == NULL || llcp_sock->dev == NULL)
return -EBADFD;
addr->sa_family = AF_NFC;
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related
* Re: Network namespace and bonding WARNING at fs/proc/generic.c remove_proc_entry
From: Eric W. Biederman @ 2012-07-06 18:57 UTC (permalink / raw)
To: Serge E. Hallyn
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
Dilip Daya, linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120706170538.GA31679-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
"Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org> writes:
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index 2ee8cf9..818ed64 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -4345,6 +4345,9 @@ static void bond_setup(struct net_device *bond_dev)
>> bond_dev->priv_flags |= IFF_BONDING;
>> bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
>>
>> + /* Don't allow bond devices to change network namespaces. */
>> + bond_dev->features |= NETIF_F_LOCAL;
>
> I believe this needs to be NETIF_F_NETNS_LOCAL. Test build still going with
> that change.
Yes that is what I mean.
Eric
^ permalink raw reply
* Re: [PATCH] ipv4: Avoid overhead when no custom FIB rules are installed.
From: David Miller @ 2012-07-06 18:53 UTC (permalink / raw)
To: bhutchings; +Cc: netdev
In-Reply-To: <1341595171.2923.2.camel@bwh-desktop.uk.solarflarecom.com>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 6 Jul 2012 18:19:31 +0100
> Do you really mean to set fib_has_custom_rules = true on deletion?
Yes, because someone could delete one of the default rules, which
would make our shortcut invalid.
^ permalink raw reply
* Re: Network namespace and bonding WARNING at fs/proc/generic.c remove_proc_entry
From: Eric W. Biederman @ 2012-07-06 18:40 UTC (permalink / raw)
To: dilip.daya; +Cc: Serge E. Hallyn, linux-kernel, containers, netdev
In-Reply-To: <1341597680.2829.22.camel@pro6455b.example.com>
Dilip Daya <dilip.daya@hp.com> writes:
> Hi Eric,
> We do need to move bonds between namespaces - because we require
> physical interfaces in each namespace -- we don't want the overheads of
> virtual interfaces, don't have the management infrastructure, and don't
> want to manufacture fake mac addresses that would be required for
> macvlan interfaces. Since the bonds are implicitly created in the host
> namespace, the only way we know to get bonds directly into the
> namespaces is to move them.
There about 3 ways to create bonding devices. One of those ways
is to create bonding devices when loading the module. Another
way is to create a bond device with "echo '+bond35 > /sys/class/net/bonding_masters".
them when loading the module, and my favorite is the standard way
"ip link add type bond". All but loading the bonding device work in the
network namespace you are in at the type.
> Would "NETDEV_UNREGISTER and NETDEV_REGISTER events to remove/add the
> per device proc files at the appropriate time." help in the case?
Yes. But since you can create the bonding device in the network
namespace you need it in, I don't see the point, of adding a code
path no one will test for 3 years at a time.
It seems easier to me to just not allow migration of bonding devices
and set peoples expectations a little lower. Especially given
the very complex user space interfaces.
On ther other hand if you want to write and test and generally own the
patch I will review it.
Eric
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox