Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca9354a1 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hns-next'



Yisen Zhuang says:

====================
net: hns: fix the typo of hns

This series includes typo fixes which review by Andy, adding
the hns maintainer to MAINTAINERS, as below:

 > from Daode: adds the maintainer for hns driver;

 > from Daode: fix the typo of hns reviewed by Andy Shevchenko;

 > from Kejian: one remove redundant function and two fix to get
configuration from DT.

changlog:
 v2 -> v3:
  match all files in and below drivers/net/ethernet/hisilicon/

 v1 -> v2:
  fix the indentations reviewed by David.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1364db42 b15dc292
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5437,6 +5437,15 @@ F: include/uapi/linux/if_hippi.h
F:	net/802/hippi.c
F:	drivers/net/hippi/

HISILICON NETWORK SUBSYSTEM DRIVER
M:	Yisen Zhuang <yisen.zhuang@huawei.com>
M:	Salil Mehta <salil.mehta@huawei.com>
L:	netdev@vger.kernel.org
W:	http://www.hisilicon.com
S:	Maintained
F:	drivers/net/ethernet/hisilicon/
F:	Documentation/devicetree/bindings/net/hisilicon*.txt

HISILICON SAS Controller
M:	John Garry <john.garry@huawei.com>
W:	http://www.hisilicon.com
+9 −0
Original line number Diff line number Diff line
@@ -363,6 +363,14 @@ enum hnae_port_type {
	HNAE_PORT_DEBUG
};

/* mac media type */
enum hnae_media_type {
	HNAE_MEDIA_TYPE_UNKNOWN = 0,
	HNAE_MEDIA_TYPE_FIBER,
	HNAE_MEDIA_TYPE_COPPER,
	HNAE_MEDIA_TYPE_BACKPLANE,
};

/* This struct defines the operation on the handle.
 *
 * get_handle(): (mandatory)
@@ -525,6 +533,7 @@ struct hnae_handle {
	u32 eport_id;
	u32 dport_id;	/* v2 tx bd should fill the dport_id */
	enum hnae_port_type port_type;
	enum hnae_media_type media_type;
	struct list_head node;    /* list to hnae_ae_dev->handle_list */
	struct hnae_buf_ops *bops; /* operation for the buffer */
	struct hnae_queue **qs;  /* array base of all queues */
+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ struct hnae_handle *hns_ae_get_handle(struct hnae_ae_dev *dev,
	ae_handle->phy_dev = vf_cb->mac_cb->phy_dev;
	ae_handle->if_support = vf_cb->mac_cb->if_support;
	ae_handle->port_type = vf_cb->mac_cb->mac_type;
	ae_handle->media_type = vf_cb->mac_cb->media_type;
	ae_handle->dport_id = port_id;

	return ae_handle;
+26 −15
Original line number Diff line number Diff line
@@ -56,20 +56,6 @@ static const enum mac_mode g_mac_mode_1000[] = {
	[PHY_INTERFACE_MODE_RTBI]   = MAC_MODE_RTBI_1000
};

static enum mac_mode hns_mac_dev_to_enet_if(const struct hns_mac_cb *mac_cb)
{
	switch (mac_cb->max_speed) {
	case MAC_SPEED_100:
		return g_mac_mode_100[mac_cb->phy_if];
	case MAC_SPEED_1000:
		return g_mac_mode_1000[mac_cb->phy_if];
	case MAC_SPEED_10000:
		return MAC_MODE_XGMII_10000;
	default:
		return MAC_MODE_MII_100;
	}
}

static enum mac_mode hns_get_enet_interface(const struct hns_mac_cb *mac_cb)
{
	switch (mac_cb->max_speed) {
@@ -134,7 +120,6 @@ void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex)

	mac_cb->speed = speed;
	mac_cb->half_duplex = !duplex;
	mac_ctrl_drv->mac_mode = hns_mac_dev_to_enet_if(mac_cb);

	if (mac_ctrl_drv->adjust_link) {
		ret = mac_ctrl_drv->adjust_link(mac_ctrl_drv,
@@ -748,6 +733,18 @@ static void hns_mac_register_phy(struct hns_mac_cb *mac_cb)
			mac_cb->mac_id, addr);
}

#define MAC_MEDIA_TYPE_MAX_LEN		16

static const struct {
	enum hnae_media_type value;
	const char *name;
} media_type_defs[] = {
	{HNAE_MEDIA_TYPE_UNKNOWN,	"unknown" },
	{HNAE_MEDIA_TYPE_FIBER,		"fiber" },
	{HNAE_MEDIA_TYPE_COPPER,	"copper" },
	{HNAE_MEDIA_TYPE_BACKPLANE,	"backplane" },
};

/**
 *hns_mac_get_info  - get mac information from device node
 *@mac_cb: mac device
@@ -759,10 +756,13 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
	struct device_node *np;
	struct regmap *syscon;
	struct of_phandle_args cpld_args;
	const char *media_type;
	u32 i;
	u32 ret;

	mac_cb->link = false;
	mac_cb->half_duplex = false;
	mac_cb->media_type = HNAE_MEDIA_TYPE_UNKNOWN;
	mac_cb->speed = mac_phy_to_speed[mac_cb->phy_if];
	mac_cb->max_speed = mac_cb->speed;

@@ -864,6 +864,17 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
			mac_cb->mac_id);
	}

	if (!fwnode_property_read_string(mac_cb->fw_port, "media-type",
					 &media_type)) {
		for (i = 0; i < ARRAY_SIZE(media_type_defs); i++) {
			if (!strncmp(media_type_defs[i].name, media_type,
				     MAC_MEDIA_TYPE_MAX_LEN)) {
				mac_cb->media_type = media_type_defs[i].value;
				break;
			}
		}
	}

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -335,6 +335,7 @@ struct hns_mac_cb {
	u64 txpkt_for_led;
	u64 rxpkt_for_led;
	enum hnae_port_type mac_type;
	enum hnae_media_type media_type;
	phy_interface_t phy_if;
	enum hnae_loop loop_mode;

Loading