diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-11-09 10:55:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-11-09 10:55:05 +0100 |
commit | 227426f16163d3721fee82650980aae0eef01375 (patch) | |
tree | a64101906c15b814ec942468e88875ce8160e45d /include | |
parent | c024f90f5dd5604d3f82dbbc055fd88a69d59187 (diff) | |
parent | ac7324a0ed12a67fc836b383388f2562d32e55ed (diff) | |
download | barebox-227426f16163d3721fee82650980aae0eef01375.tar.gz barebox-227426f16163d3721fee82650980aae0eef01375.tar.xz |
Merge branch 'for-next/net-switch-mv88e6xxx'
Diffstat (limited to 'include')
-rw-r--r-- | include/driver.h | 25 | ||||
-rw-r--r-- | include/linux/ethtool.h | 3 | ||||
-rw-r--r-- | include/linux/phy.h | 9 | ||||
-rw-r--r-- | include/linux/string.h | 12 | ||||
-rw-r--r-- | include/of.h | 6 |
5 files changed, 49 insertions, 6 deletions
diff --git a/include/driver.h b/include/driver.h index 63facbfbe5..7da184d3ab 100644 --- a/include/driver.h +++ b/include/driver.h @@ -23,7 +23,6 @@ #include <linux/ioport.h> #include <of.h> -#define MAX_DRIVER_NAME 32 #define FORMAT_DRIVER_NAME_ID "%s%d" #include <param.h> @@ -38,10 +37,19 @@ struct platform_device_id { /** @brief Describes a particular device present in the system */ struct device_d { - /*! This member (and 'type' described below) is used to match with a - * driver. This is a descriptive name and could be MPC5XXX_ether or - * imx_serial. */ - char name[MAX_DRIVER_NAME]; + /*! This member (and 'type' described below) is used to match + * with a driver. This is a descriptive name and could be + * MPC5XXX_ether or imx_serial. Unless absolutely necessary, + * should not be modified directly and dev_set_name() should + * be used instead. + */ + char *name; + + /*! This member is used to store device's unique name as + * obtained by calling dev_id(). Internal field, do not + * access it directly. + */ + char *unique_name; /*! The id is used to uniquely identify a device in the system. The id * will show up under /dev/ as the device's name. Usually this is * something like eth0 or nor0. */ @@ -170,13 +178,18 @@ int get_free_deviceid(const char *name_template); char *deviceid_from_spec_str(const char *str, char **endp); -extern const char *dev_id(const struct device_d *dev); +static inline const char *dev_id(const struct device_d *dev) +{ + return (dev->id != DEVICE_ID_SINGLE) ? dev->unique_name : dev->name; +} static inline const char *dev_name(const struct device_d *dev) { return dev_id(dev); } +int dev_set_name(struct device_d *dev, const char *fmt, ...); + /* * get resource 'num' for a device */ diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 4d83fe019e..324e40cdeb 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -72,9 +72,12 @@ #define SPEED_2500 2500 #define SPEED_10000 10000 +#define SPEED_UNKNOWN -1 + /* Duplex, half or full. */ #define DUPLEX_HALF 0x00 #define DUPLEX_FULL 0x01 +#define DUPLEX_UNKNOWN 0xff /* Which connector port. */ #define PORT_TP 0x00 diff --git a/include/linux/phy.h b/include/linux/phy.h index ac750f5c3a..5b2c63ff69 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -54,7 +54,16 @@ typedef enum { PHY_INTERFACE_MODE_RGMII_TXID, PHY_INTERFACE_MODE_RTBI, PHY_INTERFACE_MODE_SMII, + PHY_INTERFACE_MODE_XGMII, PHY_INTERFACE_MODE_QSGMII, + PHY_INTERFACE_MODE_TRGMII, + PHY_INTERFACE_MODE_1000BASEX, + PHY_INTERFACE_MODE_2500BASEX, + PHY_INTERFACE_MODE_RXAUI, + PHY_INTERFACE_MODE_XAUI, + /* 10GBASE-KR, XFI, SFI - single lane 10G Serdes */ + PHY_INTERFACE_MODE_10GKR, + PHY_INTERFACE_MODE_MAX, } phy_interface_t; #define PHY_INIT_TIMEOUT 100000 diff --git a/include/linux/string.h b/include/linux/string.h index 90fe1b6ec8..fd42f5020a 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -111,6 +111,18 @@ extern char *strim(char *); void *memchr_inv(const void *start, int c, size_t bytes); +/** + * kbasename - return the last part of a pathname. + * + * @path: path to extract the filename from. + */ +static inline const char *kbasename(const char *path) +{ + const char *tail = strrchr(path, '/'); + return tail ? tail + 1 : path; +} + + #ifdef __cplusplus } #endif diff --git a/include/of.h b/include/of.h index 7fc4b7791f..184acb4741 100644 --- a/include/of.h +++ b/include/of.h @@ -321,6 +321,12 @@ static inline int of_set_root_node(struct device_node *node) return -ENOSYS; } +static inline struct device_d *of_platform_device_create(struct device_node *np, + struct device_d *parent) +{ + return NULL; +} + static inline int of_n_addr_cells(struct device_node *np) { return 0; |