1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/types.h>
8 * The NCSI device states seen from external. More NCSI device states are
9 * only visible internally (in net/ncsi/internal.h). When the NCSI device
10 * is registered, it's in ncsi_dev_state_registered state. The state
11 * ncsi_dev_state_start is used to drive to choose active package and
12 * channel. After that, its state is changed to ncsi_dev_state_functional.
14 * The state ncsi_dev_state_stop helps to shut down the currently active
15 * package and channel while ncsi_dev_state_config helps to reconfigure
19 ncsi_dev_state_registered = 0x0000,
20 ncsi_dev_state_functional = 0x0100,
21 ncsi_dev_state_probe = 0x0200,
22 ncsi_dev_state_config = 0x0300,
23 ncsi_dev_state_suspend = 0x0400,
29 struct net_device *dev;
30 void (*handler)(struct ncsi_dev *ndev);
33 #ifdef CONFIG_NET_NCSI
34 int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid);
35 int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid);
36 struct ncsi_dev *ncsi_register_dev(struct net_device *dev,
37 void (*notifier)(struct ncsi_dev *nd));
38 int ncsi_start_dev(struct ncsi_dev *nd);
39 void ncsi_stop_dev(struct ncsi_dev *nd);
40 void ncsi_unregister_dev(struct ncsi_dev *nd);
41 #else /* !CONFIG_NET_NCSI */
42 static inline int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
47 static inline int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
52 static inline struct ncsi_dev *ncsi_register_dev(struct net_device *dev,
53 void (*notifier)(struct ncsi_dev *nd))
58 static inline int ncsi_start_dev(struct ncsi_dev *nd)
63 static void ncsi_stop_dev(struct ncsi_dev *nd)
67 static inline void ncsi_unregister_dev(struct ncsi_dev *nd)
70 #endif /* CONFIG_NET_NCSI */
72 #endif /* __NET_NCSI_H */