From: Igor Russkikh <Igor.Russkikh@aquantia.com> To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "davem@davemloft.net" <davem@davemloft.net>, "netdev@vger.kernel.org" <netdev@vger.kernel.org> Cc: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>, Igor Russkikh <Igor.Russkikh@aquantia.com> Subject: [PATCH net 1/2] net: usb: aqc111: Add read_mdio operation Date: Wed, 12 Dec 2018 13:50:08 +0000 [thread overview] Message-ID: <f07449227d8f6d2a3e82fe6cbe6886214527ecc7.1544622414.git.igor.russkikh@aquantia.com> (raw) In-Reply-To: <cover.1544622414.git.igor.russkikh@aquantia.com> From: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com> Add necessary defines to read phy registers and temparature Signed-off-by: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> --- drivers/net/usb/aqc111.c | 5 +++++ drivers/net/usb/aqc111.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 57f1c94fca0b..8867f6a3eaa7 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -193,6 +193,11 @@ static int aqc111_write16_cmd_async(struct usbnet *dev, u8 cmd, u16 value, sizeof(tmp), &tmp); } +static int aqc111_mdio_read(struct usbnet *dev, u16 value, u16 index, u16 *data) +{ + return aqc111_read16_cmd(dev, AQ_PHY_CMD, value, index, data); +} + static void aqc111_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info) { diff --git a/drivers/net/usb/aqc111.h b/drivers/net/usb/aqc111.h index 4d68b3a6067c..359663635b49 100644 --- a/drivers/net/usb/aqc111.h +++ b/drivers/net/usb/aqc111.h @@ -18,9 +18,20 @@ #define AQ_ACCESS_MAC 0x01 #define AQ_FLASH_PARAMETERS 0x20 #define AQ_PHY_POWER 0x31 +#define AQ_PHY_CMD 0x32 #define AQ_WOL_CFG 0x60 #define AQ_PHY_OPS 0x61 +#define AQC111_PHY_ID 0x00 +#define AQ_PHY_ADDR(mmd) ((AQC111_PHY_ID << 8) | (mmd)) + +#define AQ_PHY_GLOBAL_MMD 0x1E +#define AQ_PHY_GLOBAL_ADDR AQ_PHY_ADDR(AQ_PHY_GLOBAL_MMD) + +#define AQ_GLB_THERMAL_STATUS1 0xC820 +#define AQ_GLB_THERMAL_STATUS2 0xC821 + #define AQ_THERM_ST_READY 0x0001 + #define AQ_USB_PHY_SET_TIMEOUT 10000 #define AQ_USB_SET_TIMEOUT 4000 -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Igor Russkikh <igor.russkikh@aquantia.com> To: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "davem@davemloft.net" <davem@davemloft.net>, "netdev@vger.kernel.org" <netdev@vger.kernel.org> Cc: Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>, Igor Russkikh <Igor.Russkikh@aquantia.com> Subject: [net,1/2] net: usb: aqc111: Add read_mdio operation Date: Wed, 12 Dec 2018 13:50:08 +0000 [thread overview] Message-ID: <f07449227d8f6d2a3e82fe6cbe6886214527ecc7.1544622414.git.igor.russkikh@aquantia.com> (raw) From: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com> Add necessary defines to read phy registers and temparature Signed-off-by: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> --- drivers/net/usb/aqc111.c | 5 +++++ drivers/net/usb/aqc111.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 57f1c94fca0b..8867f6a3eaa7 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -193,6 +193,11 @@ static int aqc111_write16_cmd_async(struct usbnet *dev, u8 cmd, u16 value, sizeof(tmp), &tmp); } +static int aqc111_mdio_read(struct usbnet *dev, u16 value, u16 index, u16 *data) +{ + return aqc111_read16_cmd(dev, AQ_PHY_CMD, value, index, data); +} + static void aqc111_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info) { diff --git a/drivers/net/usb/aqc111.h b/drivers/net/usb/aqc111.h index 4d68b3a6067c..359663635b49 100644 --- a/drivers/net/usb/aqc111.h +++ b/drivers/net/usb/aqc111.h @@ -18,9 +18,20 @@ #define AQ_ACCESS_MAC 0x01 #define AQ_FLASH_PARAMETERS 0x20 #define AQ_PHY_POWER 0x31 +#define AQ_PHY_CMD 0x32 #define AQ_WOL_CFG 0x60 #define AQ_PHY_OPS 0x61 +#define AQC111_PHY_ID 0x00 +#define AQ_PHY_ADDR(mmd) ((AQC111_PHY_ID << 8) | (mmd)) + +#define AQ_PHY_GLOBAL_MMD 0x1E +#define AQ_PHY_GLOBAL_ADDR AQ_PHY_ADDR(AQ_PHY_GLOBAL_MMD) + +#define AQ_GLB_THERMAL_STATUS1 0xC820 +#define AQ_GLB_THERMAL_STATUS2 0xC821 + #define AQ_THERM_ST_READY 0x0001 + #define AQ_USB_PHY_SET_TIMEOUT 10000 #define AQ_USB_SET_TIMEOUT 4000
next prev parent reply other threads:[~2018-12-12 13:50 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-12-12 13:50 [PATCH net 0/2] aqc111: Thermal throttling feature Igor Russkikh 2018-12-12 13:50 ` Igor Russkikh [this message] 2018-12-12 13:50 ` [net,1/2] net: usb: aqc111: Add read_mdio operation Igor Russkikh 2018-12-12 16:11 ` [PATCH net 1/2] " Andrew Lunn 2018-12-12 16:11 ` [net,1/2] " Andrew Lunn 2018-12-12 19:38 ` [PATCH net 1/2] " Igor Russkikh 2018-12-12 19:38 ` [net,1/2] " Igor Russkikh 2018-12-12 13:50 ` [PATCH net 2/2] net: usb: aqc111: Support for thermal throttling feature Igor Russkikh 2018-12-12 13:50 ` [net,2/2] " Igor Russkikh 2018-12-12 16:08 ` [PATCH net 2/2] " Andrew Lunn 2018-12-12 16:08 ` [net,2/2] " Andrew Lunn 2018-12-12 19:34 ` [PATCH net 2/2] " Igor Russkikh 2018-12-12 19:34 ` [net,2/2] " Igor Russkikh 2018-12-12 20:28 ` [PATCH net 2/2] " Andrew Lunn 2018-12-12 20:28 ` [net,2/2] " Andrew Lunn 2018-12-12 13:54 ` [PATCH net 0/2] aqc111: Thermal " Igor Russkikh 2018-12-12 18:15 ` Florian Fainelli 2018-12-12 20:08 ` Igor Russkikh 2018-12-12 20:28 ` Florian Fainelli 2018-12-12 20:38 ` Andrew Lunn 2018-12-13 0:43 ` David Miller 2018-12-14 11:43 ` Igor Russkikh 2018-12-13 0:18 ` David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=f07449227d8f6d2a3e82fe6cbe6886214527ecc7.1544622414.git.igor.russkikh@aquantia.com \ --to=igor.russkikh@aquantia.com \ --cc=Dmitry.Bezrukov@aquantia.com \ --cc=davem@davemloft.net \ --cc=linux-usb@vger.kernel.org \ --cc=netdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.