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

Commit d38dd52c authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

lpfc: Add support for Lancer G6 and 32G FC links

parent 6599eaaa
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -495,15 +495,17 @@ struct unsol_rcv_ct_ctx {
#define LPFC_USER_LINK_SPEED_8G		8	/* 8 Gigabaud */
#define LPFC_USER_LINK_SPEED_10G	10	/* 10 Gigabaud */
#define LPFC_USER_LINK_SPEED_16G	16	/* 16 Gigabaud */
#define LPFC_USER_LINK_SPEED_MAX	LPFC_USER_LINK_SPEED_16G
#define LPFC_USER_LINK_SPEED_BITMAP ((1 << LPFC_USER_LINK_SPEED_16G) | \
#define LPFC_USER_LINK_SPEED_32G	32	/* 32 Gigabaud */
#define LPFC_USER_LINK_SPEED_MAX	LPFC_USER_LINK_SPEED_32G
#define LPFC_USER_LINK_SPEED_BITMAP  ((1ULL << LPFC_USER_LINK_SPEED_32G) | \
				     (1 << LPFC_USER_LINK_SPEED_16G) | \
				     (1 << LPFC_USER_LINK_SPEED_10G) | \
				     (1 << LPFC_USER_LINK_SPEED_8G) | \
				     (1 << LPFC_USER_LINK_SPEED_4G) | \
				     (1 << LPFC_USER_LINK_SPEED_2G) | \
				     (1 << LPFC_USER_LINK_SPEED_1G) | \
				     (1 << LPFC_USER_LINK_SPEED_AUTO))
#define LPFC_LINK_SPEED_STRING "0, 1, 2, 4, 8, 10, 16"
#define LPFC_LINK_SPEED_STRING "0, 1, 2, 4, 8, 10, 16, 32"

enum nemb_type {
	nemb_mse = 1,
+13 −4
Original line number Diff line number Diff line
@@ -3276,15 +3276,20 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,

	if (val >= 0 && val <= 6) {
		prev_val = phba->cfg_topology;
		phba->cfg_topology = val;
		if (phba->cfg_link_speed == LPFC_USER_LINK_SPEED_16G &&
			val == 4) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				"3113 Loop mode not supported at speed %d\n",
				phba->cfg_link_speed);
			phba->cfg_topology = prev_val;
				val);
			return -EINVAL;
		}
		if (phba->pcidev->device == PCI_DEVICE_ID_LANCER_G6_FC &&
			val == 4) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				"3114 Loop mode not supported\n");
			return -EINVAL;
		}
		phba->cfg_topology = val;
		if (nolip)
			return strlen(buf);

@@ -3725,7 +3730,8 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
	    ((val == LPFC_USER_LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) ||
	    ((val == LPFC_USER_LINK_SPEED_8G) && !(phba->lmt & LMT_8Gb)) ||
	    ((val == LPFC_USER_LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)) ||
	    ((val == LPFC_USER_LINK_SPEED_16G) && !(phba->lmt & LMT_16Gb))) {
	    ((val == LPFC_USER_LINK_SPEED_16G) && !(phba->lmt & LMT_16Gb)) ||
	    ((val == LPFC_USER_LINK_SPEED_32G) && !(phba->lmt & LMT_32Gb))) {
		lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
				"2879 lpfc_link_speed attribute cannot be set "
				"to %d. Speed is not supported by this port.\n",
@@ -5261,6 +5267,9 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
		case LPFC_LINK_SPEED_16GHZ:
			fc_host_speed(shost) = FC_PORTSPEED_16GBIT;
			break;
		case LPFC_LINK_SPEED_32GHZ:
			fc_host_speed(shost) = FC_PORTSPEED_32GBIT;
			break;
		default:
			fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
			break;
+6 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@
#define HBA_PORTSPEED_10GBIT		0x0004	/* 10 GBit/sec */
#define HBA_PORTSPEED_8GBIT		0x0010	/* 8 GBit/sec */
#define HBA_PORTSPEED_16GBIT		0x0020	/* 16 GBit/sec */
#define HBA_PORTSPEED_32GBIT		0x0040  /* 32 GBit/sec */
#define HBA_PORTSPEED_UNKNOWN		0x0800	/* Unknown */

#define FOURBYTES	4
@@ -1773,6 +1774,8 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
			ad->AttrType = cpu_to_be16(RPRT_SUPPORTED_SPEED);
			ad->AttrLen = cpu_to_be16(FOURBYTES + 4);
			ae->un.SupportSpeed = 0;
			if (phba->lmt & LMT_32Gb)
				ae->un.SupportSpeed |= HBA_PORTSPEED_32GBIT;
			if (phba->lmt & LMT_16Gb)
				ae->un.SupportSpeed |= HBA_PORTSPEED_16GBIT;
			if (phba->lmt & LMT_10Gb)
@@ -1816,6 +1819,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
			case LPFC_LINK_SPEED_16GHZ:
				ae->un.PortSpeed = HBA_PORTSPEED_16GBIT;
				break;
			case LPFC_LINK_SPEED_32GHZ:
				ae->un.PortSpeed = HBA_PORTSPEED_32GBIT;
				break;
			default:
				ae->un.PortSpeed = HBA_PORTSPEED_UNKNOWN;
				break;
+2 −0
Original line number Diff line number Diff line
@@ -4705,6 +4705,8 @@ lpfc_rdp_res_speed(struct fc_rdp_port_speed_desc *desc, struct lpfc_hba *phba)

	desc->info.port_speed.speed = cpu_to_be16(rdp_speed);

	if (phba->lmt & LMT_32Gb)
		rdp_cap |= RDP_PS_32GB;
	if (phba->lmt & LMT_16Gb)
		rdp_cap |= RDP_PS_16GB;
	if (phba->lmt & LMT_10Gb)
+1 −0
Original line number Diff line number Diff line
@@ -3029,6 +3029,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la)
	case LPFC_LINK_SPEED_8GHZ:
	case LPFC_LINK_SPEED_10GHZ:
	case LPFC_LINK_SPEED_16GHZ:
	case LPFC_LINK_SPEED_32GHZ:
		phba->fc_linkspeed = bf_get(lpfc_mbx_read_top_link_spd, la);
		break;
	default:
Loading