diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 1849e33e68f9..bf33b315f93e 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -869,6 +869,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba, | |||
869 | LPFC_MBOXQ_t *pmboxq; | 869 | LPFC_MBOXQ_t *pmboxq; |
870 | MAILBOX_t *pmb; | 870 | MAILBOX_t *pmb; |
871 | int rc = 0; | 871 | int rc = 0; |
872 | uint32_t max_vpi; | ||
872 | 873 | ||
873 | /* | 874 | /* |
874 | * prevent udev from issuing mailbox commands until the port is | 875 | * prevent udev from issuing mailbox commands until the port is |
@@ -916,11 +917,17 @@ lpfc_get_hba_info(struct lpfc_hba *phba, | |||
916 | if (axri) | 917 | if (axri) |
917 | *axri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config) - | 918 | *axri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config) - |
918 | phba->sli4_hba.max_cfg_param.xri_used; | 919 | phba->sli4_hba.max_cfg_param.xri_used; |
920 | |||
921 | /* Account for differences with SLI-3. Get vpi count from | ||
922 | * mailbox data and subtract one for max vpi value. | ||
923 | */ | ||
924 | max_vpi = (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) > 0) ? | ||
925 | (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - 1) : 0; | ||
926 | |||
919 | if (mvpi) | 927 | if (mvpi) |
920 | *mvpi = bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config); | 928 | *mvpi = max_vpi; |
921 | if (avpi) | 929 | if (avpi) |
922 | *avpi = bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - | 930 | *avpi = max_vpi - phba->sli4_hba.max_cfg_param.vpi_used; |
923 | phba->sli4_hba.max_cfg_param.vpi_used; | ||
924 | } else { | 931 | } else { |
925 | if (mrpi) | 932 | if (mrpi) |
926 | *mrpi = pmb->un.varRdConfig.max_rpi; | 933 | *mrpi = pmb->un.varRdConfig.max_rpi; |
@@ -1925,13 +1932,12 @@ MODULE_PARM_DESC(lpfc_sli_mode, "SLI mode selector:" | |||
1925 | " 2 - select SLI-2 even on SLI-3 capable HBAs," | 1932 | " 2 - select SLI-2 even on SLI-3 capable HBAs," |
1926 | " 3 - select SLI-3"); | 1933 | " 3 - select SLI-3"); |
1927 | 1934 | ||
1928 | int lpfc_enable_npiv = 0; | 1935 | int lpfc_enable_npiv = 1; |
1929 | module_param(lpfc_enable_npiv, int, 0); | 1936 | module_param(lpfc_enable_npiv, int, 0); |
1930 | MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality"); | 1937 | MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality"); |
1931 | lpfc_param_show(enable_npiv); | 1938 | lpfc_param_show(enable_npiv); |
1932 | lpfc_param_init(enable_npiv, 0, 0, 1); | 1939 | lpfc_param_init(enable_npiv, 1, 0, 1); |
1933 | static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, | 1940 | static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO, lpfc_enable_npiv_show, NULL); |
1934 | lpfc_enable_npiv_show, NULL); | ||
1935 | 1941 | ||
1936 | /* | 1942 | /* |
1937 | # lpfc_suppress_link_up: Bring link up at initialization | 1943 | # lpfc_suppress_link_up: Bring link up at initialization |
@@ -2637,6 +2643,7 @@ static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR, | |||
2637 | 2643 | ||
2638 | /** | 2644 | /** |
2639 | * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute | 2645 | * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute |
2646 | * @filp: sysfs file | ||
2640 | * @kobj: Pointer to the kernel object | 2647 | * @kobj: Pointer to the kernel object |
2641 | * @bin_attr: Attribute object | 2648 | * @bin_attr: Attribute object |
2642 | * @buff: Buffer pointer | 2649 | * @buff: Buffer pointer |
@@ -2648,7 +2655,8 @@ static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR, | |||
2648 | * applications. | 2655 | * applications. |
2649 | **/ | 2656 | **/ |
2650 | static ssize_t | 2657 | static ssize_t |
2651 | sysfs_drvr_stat_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 2658 | sysfs_drvr_stat_data_read(struct file *filp, struct kobject *kobj, |
2659 | struct bin_attribute *bin_attr, | ||
2652 | char *buf, loff_t off, size_t count) | 2660 | char *buf, loff_t off, size_t count) |
2653 | { | 2661 | { |
2654 | struct device *dev = container_of(kobj, struct device, | 2662 | struct device *dev = container_of(kobj, struct device, |
@@ -3356,6 +3364,7 @@ struct device_attribute *lpfc_vport_attrs[] = { | |||
3356 | 3364 | ||
3357 | /** | 3365 | /** |
3358 | * sysfs_ctlreg_write - Write method for writing to ctlreg | 3366 | * sysfs_ctlreg_write - Write method for writing to ctlreg |
3367 | * @filp: open sysfs file | ||
3359 | * @kobj: kernel kobject that contains the kernel class device. | 3368 | * @kobj: kernel kobject that contains the kernel class device. |
3360 | * @bin_attr: kernel attributes passed to us. | 3369 | * @bin_attr: kernel attributes passed to us. |
3361 | * @buf: contains the data to be written to the adapter IOREG space. | 3370 | * @buf: contains the data to be written to the adapter IOREG space. |
@@ -3373,7 +3382,8 @@ struct device_attribute *lpfc_vport_attrs[] = { | |||
3373 | * value of count, buf contents written | 3382 | * value of count, buf contents written |
3374 | **/ | 3383 | **/ |
3375 | static ssize_t | 3384 | static ssize_t |
3376 | sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, | 3385 | sysfs_ctlreg_write(struct file *filp, struct kobject *kobj, |
3386 | struct bin_attribute *bin_attr, | ||
3377 | char *buf, loff_t off, size_t count) | 3387 | char *buf, loff_t off, size_t count) |
3378 | { | 3388 | { |
3379 | size_t buf_off; | 3389 | size_t buf_off; |
@@ -3409,6 +3419,7 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
3409 | 3419 | ||
3410 | /** | 3420 | /** |
3411 | * sysfs_ctlreg_read - Read method for reading from ctlreg | 3421 | * sysfs_ctlreg_read - Read method for reading from ctlreg |
3422 | * @filp: open sysfs file | ||
3412 | * @kobj: kernel kobject that contains the kernel class device. | 3423 | * @kobj: kernel kobject that contains the kernel class device. |
3413 | * @bin_attr: kernel attributes passed to us. | 3424 | * @bin_attr: kernel attributes passed to us. |
3414 | * @buf: if successful contains the data from the adapter IOREG space. | 3425 | * @buf: if successful contains the data from the adapter IOREG space. |
@@ -3425,7 +3436,8 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
3425 | * value of count, buf contents read | 3436 | * value of count, buf contents read |
3426 | **/ | 3437 | **/ |
3427 | static ssize_t | 3438 | static ssize_t |
3428 | sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 3439 | sysfs_ctlreg_read(struct file *filp, struct kobject *kobj, |
3440 | struct bin_attribute *bin_attr, | ||
3429 | char *buf, loff_t off, size_t count) | 3441 | char *buf, loff_t off, size_t count) |
3430 | { | 3442 | { |
3431 | size_t buf_off; | 3443 | size_t buf_off; |
@@ -3490,6 +3502,7 @@ sysfs_mbox_idle(struct lpfc_hba *phba) | |||
3490 | 3502 | ||
3491 | /** | 3503 | /** |
3492 | * sysfs_mbox_write - Write method for writing information via mbox | 3504 | * sysfs_mbox_write - Write method for writing information via mbox |
3505 | * @filp: open sysfs file | ||
3493 | * @kobj: kernel kobject that contains the kernel class device. | 3506 | * @kobj: kernel kobject that contains the kernel class device. |
3494 | * @bin_attr: kernel attributes passed to us. | 3507 | * @bin_attr: kernel attributes passed to us. |
3495 | * @buf: contains the data to be written to sysfs mbox. | 3508 | * @buf: contains the data to be written to sysfs mbox. |
@@ -3510,7 +3523,8 @@ sysfs_mbox_idle(struct lpfc_hba *phba) | |||
3510 | * count number of bytes transferred | 3523 | * count number of bytes transferred |
3511 | **/ | 3524 | **/ |
3512 | static ssize_t | 3525 | static ssize_t |
3513 | sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, | 3526 | sysfs_mbox_write(struct file *filp, struct kobject *kobj, |
3527 | struct bin_attribute *bin_attr, | ||
3514 | char *buf, loff_t off, size_t count) | 3528 | char *buf, loff_t off, size_t count) |
3515 | { | 3529 | { |
3516 | struct device *dev = container_of(kobj, struct device, kobj); | 3530 | struct device *dev = container_of(kobj, struct device, kobj); |
@@ -3565,6 +3579,7 @@ sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
3565 | 3579 | ||
3566 | /** | 3580 | /** |
3567 | * sysfs_mbox_read - Read method for reading information via mbox | 3581 | * sysfs_mbox_read - Read method for reading information via mbox |
3582 | * @filp: open sysfs file | ||
3568 | * @kobj: kernel kobject that contains the kernel class device. | 3583 | * @kobj: kernel kobject that contains the kernel class device. |
3569 | * @bin_attr: kernel attributes passed to us. | 3584 | * @bin_attr: kernel attributes passed to us. |
3570 | * @buf: contains the data to be read from sysfs mbox. | 3585 | * @buf: contains the data to be read from sysfs mbox. |
@@ -3587,7 +3602,8 @@ sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
3587 | * count number of bytes transferred | 3602 | * count number of bytes transferred |
3588 | **/ | 3603 | **/ |
3589 | static ssize_t | 3604 | static ssize_t |
3590 | sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 3605 | sysfs_mbox_read(struct file *filp, struct kobject *kobj, |
3606 | struct bin_attribute *bin_attr, | ||
3591 | char *buf, loff_t off, size_t count) | 3607 | char *buf, loff_t off, size_t count) |
3592 | { | 3608 | { |
3593 | struct device *dev = container_of(kobj, struct device, kobj); | 3609 | struct device *dev = container_of(kobj, struct device, kobj); |