// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016 Avago Technologies. All rights reserved.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/parser.h>
#include <uapi/scsi/fc/fc_fs.h>
#include "../host/nvme.h"
#include "../target/nvmet.h"
#include <linux/nvme-fc-driver.h>
#include <linux/nvme-fc.h>
enum {
NVMF_OPT_ERR = 0,
NVMF_OPT_WWNN = 1 << 0,
NVMF_OPT_WWPN = 1 << 1,
NVMF_OPT_ROLES = 1 << 2,
NVMF_OPT_FCADDR = 1 << 3,
NVMF_OPT_LPWWNN = 1 << 4,
NVMF_OPT_LPWWPN = 1 << 5,
};
struct fcloop_ctrl_options {
int mask;
u64 wwnn;
u64 wwpn;
u32 roles;
u32 fcaddr;
u64 lpwwnn;
u64 lpwwpn;
};
static const match_table_t opt_tokens = {
{ NVMF_OPT_WWNN, "wwnn=%s" },
{ NVMF_OPT_WWPN, "wwpn=%s" },
{ NVMF_OPT_ROLES, "roles=%d" },
{ NVMF_OPT_FCADDR, "fcaddr=%x" },
{ NVMF_OPT_LPWWNN, "lpwwnn=%s" },
{ NVMF_OPT_LPWWPN, "lpwwpn=%s" },
{ NVMF_OPT_ERR, NULL }
};
static int
fcloop_parse_options(struct fcloop_ctrl_options *opts,
const char *buf)
{
substring_t args[MAX_OPT_ARGS];
char *options, *o, <