diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:35:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:31 +0000 |
commit | 85c675d0d09a45a135bddd15d7b385f8758c32fb (patch) | |
tree | 76267dbc9b9a130337be3640948fe397b04ac629 /drivers/scsi/qla2xxx | |
parent | Adding upstream version 6.6.15. (diff) | |
download | linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.tar.xz linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.zip |
Adding upstream version 6.7.7.upstream/6.7.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dfs.c | 59 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 5 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 6 |
3 files changed, 16 insertions, 54 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c index a7a364760b..55ff3d7482 100644 --- a/drivers/scsi/qla2xxx/qla_dfs.c +++ b/drivers/scsi/qla2xxx/qla_dfs.c @@ -528,51 +528,22 @@ qla_dfs_naqp_show(struct seq_file *s, void *unused) * * Example for creating "TEST" sysfs file: * 1. struct qla_hw_data { ... struct dentry *dfs_TEST; } - * 2. QLA_DFS_SETUP_RD(TEST, scsi_qla_host_t); + * 2. QLA_DFS_SETUP_RD(TEST); * 3. In qla2x00_dfs_setup(): * QLA_DFS_CREATE_FILE(ha, TEST, 0600, ha->dfs_dir, vha); * 4. In qla2x00_dfs_remove(): * QLA_DFS_REMOVE_FILE(ha, TEST); */ -#define QLA_DFS_SETUP_RD(_name, _ctx_struct) \ -static int \ -qla_dfs_##_name##_open(struct inode *inode, struct file *file) \ -{ \ - _ctx_struct *__ctx = inode->i_private; \ - \ - return single_open(file, qla_dfs_##_name##_show, __ctx); \ -} \ - \ -static const struct file_operations qla_dfs_##_name##_ops = { \ - .open = qla_dfs_##_name##_open, \ - .read = seq_read, \ - .llseek = seq_lseek, \ - .release = single_release, \ -}; +#define QLA_DFS_SETUP_RD(_name) DEFINE_SHOW_ATTRIBUTE(qla_dfs_##_name) -#define QLA_DFS_SETUP_RW(_name, _ctx_struct) \ -static int \ -qla_dfs_##_name##_open(struct inode *inode, struct file *file) \ -{ \ - _ctx_struct *__ctx = inode->i_private; \ - \ - return single_open(file, qla_dfs_##_name##_show, __ctx); \ -} \ - \ -static const struct file_operations qla_dfs_##_name##_ops = { \ - .open = qla_dfs_##_name##_open, \ - .read = seq_read, \ - .llseek = seq_lseek, \ - .release = single_release, \ - .write = qla_dfs_##_name##_write, \ -}; +#define QLA_DFS_SETUP_RW(_name) DEFINE_SHOW_STORE_ATTRIBUTE(qla_dfs_##_name) #define QLA_DFS_ROOT_CREATE_FILE(_name, _perm, _ctx) \ do { \ if (!qla_dfs_##_name) \ qla_dfs_##_name = debugfs_create_file(#_name, \ _perm, qla2x00_dfs_root, _ctx, \ - &qla_dfs_##_name##_ops); \ + &qla_dfs_##_name##_fops); \ } while (0) #define QLA_DFS_ROOT_REMOVE_FILE(_name) \ @@ -587,7 +558,7 @@ static const struct file_operations qla_dfs_##_name##_ops = { \ do { \ (_struct)->dfs_##_name = debugfs_create_file(#_name, \ _perm, _parent, _ctx, \ - &qla_dfs_##_name##_ops) \ + &qla_dfs_##_name##_fops) \ } while (0) #define QLA_DFS_REMOVE_FILE(_struct, _name) \ @@ -598,14 +569,6 @@ static const struct file_operations qla_dfs_##_name##_ops = { \ } \ } while (0) -static int -qla_dfs_naqp_open(struct inode *inode, struct file *file) -{ - struct scsi_qla_host *vha = inode->i_private; - - return single_open(file, qla_dfs_naqp_show, vha); -} - static ssize_t qla_dfs_naqp_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) @@ -653,15 +616,7 @@ out_free: kfree(buf); return rc; } - -static const struct file_operations dfs_naqp_ops = { - .open = qla_dfs_naqp_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = qla_dfs_naqp_write, -}; - +QLA_DFS_SETUP_RW(naqp); int qla2x00_dfs_setup(scsi_qla_host_t *vha) @@ -707,7 +662,7 @@ create_nodes: if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) { ha->tgt.dfs_naqp = debugfs_create_file("naqp", - 0400, ha->dfs_dir, vha, &dfs_naqp_ops); + 0400, ha->dfs_dir, vha, &qla_dfs_naqp_fops); if (IS_ERR(ha->tgt.dfs_naqp)) { ql_log(ql_log_warn, vha, 0xd011, "Unable to create debugFS naqp node.\n"); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index c45eef743c..03348f605c 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5,6 +5,7 @@ */ #include "qla_def.h" +#include <linux/bitfield.h> #include <linux/moduleparam.h> #include <linux/vmalloc.h> #include <linux/delay.h> @@ -633,8 +634,8 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str, size_t str_len) const char *speed_str; pcie_capability_read_dword(ha->pdev, PCI_EXP_LNKCAP, &lstat); - lspeed = lstat & PCI_EXP_LNKCAP_SLS; - lwidth = (lstat & PCI_EXP_LNKCAP_MLW) >> 4; + lspeed = FIELD_GET(PCI_EXP_LNKCAP_SLS, lstat); + lwidth = FIELD_GET(PCI_EXP_LNKCAP_MLW, lstat); switch (lspeed) { case 1: diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 68a0e6a2fb..7e7460a747 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1822,6 +1822,9 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { .tfc_wwn_attrs = tcm_qla2xxx_wwn_attrs, .tfc_tpg_base_attrs = tcm_qla2xxx_tpg_attrs, .tfc_tpg_attrib_attrs = tcm_qla2xxx_tpg_attrib_attrs, + + .default_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { @@ -1859,6 +1862,9 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { .fabric_init_nodeacl = tcm_qla2xxx_init_nodeacl, .tfc_wwn_attrs = tcm_qla2xxx_wwn_attrs, + + .default_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; static int tcm_qla2xxx_register_configfs(void) |