Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
7046 lines (6496 sloc) 236 KB
From a0df45f8baaba6bab25fdc2d6d9475fd7cba5bd2 Mon Sep 17 00:00:00 2001
From: Alexey Makhalov <amakhalov@vmware.com>
Date: Fri, 3 Feb 2017 07:11:28 -0800
Subject: [PATCH 3/3] Added rap_plugin
---
arch/x86/crypto/aesni-intel_asm.S | 10 +-
arch/x86/crypto/aesni-intel_glue.c | 4 +-
arch/x86/crypto/blowfish-x86_64-asm_64.S | 4 +-
arch/x86/crypto/camellia-aesni-avx-asm_64.S | 12 +-
arch/x86/crypto/camellia-aesni-avx2-asm_64.S | 12 +-
arch/x86/crypto/camellia-x86_64-asm_64.S | 4 +-
arch/x86/crypto/cast5-avx-x86_64-asm_64.S | 4 +-
arch/x86/crypto/cast6-avx-x86_64-asm_64.S | 12 +-
arch/x86/crypto/serpent-avx-x86_64-asm_64.S | 12 +-
arch/x86/crypto/serpent-avx2-asm_64.S | 12 +-
.../crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S | 4 +-
.../crypto/sha1-mb/sha1_mb_mgr_submit_avx2.S | 2 +-
arch/x86/crypto/sha1_ssse3_glue.c | 56 +-
arch/x86/crypto/sha256-avx-asm.S | 2 +-
arch/x86/crypto/sha256-avx2-asm.S | 2 +-
.../sha256-mb/sha256_mb_mgr_flush_avx2.S | 4 +-
.../sha256-mb/sha256_mb_mgr_submit_avx2.S | 2 +-
arch/x86/crypto/sha256-ssse3-asm.S | 2 +-
arch/x86/crypto/sha256_ni_asm.S | 2 +-
arch/x86/crypto/sha256_ssse3_glue.c | 26 +-
arch/x86/crypto/sha512-avx-asm.S | 2 +-
arch/x86/crypto/sha512-avx2-asm.S | 2 +-
.../sha512-mb/sha512_mb_mgr_flush_avx2.S | 4 +-
.../sha512-mb/sha512_mb_mgr_submit_avx2.S | 2 +-
arch/x86/crypto/sha512-ssse3-asm.S | 2 +-
arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 12 +-
arch/x86/crypto/twofish-i586-asm_32.S | 4 +-
arch/x86/crypto/twofish-x86_64-asm_64-3way.S | 2 +-
arch/x86/crypto/twofish-x86_64-asm_64.S | 4 +-
arch/x86/entry/Makefile | 2 +
arch/x86/entry/common.c | 51 ++
arch/x86/events/amd/iommu.h | 2 +-
arch/x86/include/asm/e820/api.h | 2 +-
arch/x86/include/asm/fixmap.h | 2 +-
arch/x86/include/asm/module.h | 9 +-
arch/x86/kernel/cpu/vmware.c | 8 +-
arch/x86/kernel/e820.c | 2 +-
arch/x86/kernel/ftrace_64.S | 2 +-
arch/x86/kernel/paravirt.c | 6 +-
arch/x86/kernel/traps.c | 4 +
arch/x86/mm/pgtable.c | 2 +-
arch/x86/xen/xen-asm.S | 8 +-
drivers/char/tpm/tpm-chip.c | 9 +-
drivers/firmware/dmi-id.c | 7 +-
.../gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 7 +-
.../drm/nouveau/nvkm/subdev/bios/shadowpci.c | 7 +-
drivers/gpu/drm/radeon/radeon_kms.c | 4 +-
.../net/ethernet/broadcom/bnx2x/bnx2x_link.c | 216 ++++---
.../net/ethernet/broadcom/bnx2x/bnx2x_link.h | 4 +-
drivers/net/ethernet/brocade/bna/bfa_cs.h | 42 +-
drivers/net/ethernet/brocade/bna/bfa_ioc.c | 10 +-
drivers/net/ethernet/brocade/bna/bfa_ioc.h | 4 +-
drivers/net/ethernet/brocade/bna/bfa_msgq.h | 8 +-
drivers/net/ethernet/brocade/bna/bna_enet.c | 6 +-
drivers/net/ethernet/brocade/bna/bna_tx_rx.c | 6 +-
drivers/net/ethernet/brocade/bna/bna_types.h | 24 +-
drivers/net/ethernet/brocade/bna/bnad.c | 11 +-
drivers/ras/ras.c | 2 +-
drivers/scsi/aacraid/aachba.c | 7 +-
drivers/scsi/bfa/bfa.h | 4 +-
drivers/scsi/bfa/bfa_core.c | 4 +-
drivers/scsi/bfa/bfa_cs.h | 124 +++-
drivers/scsi/bfa/bfa_fcpim.h | 12 +-
drivers/scsi/bfa/bfa_fcs.h | 34 +-
drivers/scsi/bfa/bfa_fcs_fcpim.c | 6 +-
drivers/scsi/bfa/bfa_fcs_lport.c | 4 +-
drivers/scsi/bfa/bfa_fcs_rport.c | 4 +-
drivers/scsi/bfa/bfa_ioc.c | 8 +-
drivers/scsi/bfa/bfa_ioc.h | 12 +-
drivers/scsi/bfa/bfa_svc.c | 12 +-
drivers/scsi/bfa/bfa_svc.h | 20 +-
drivers/scsi/bfa/bfad.c | 12 +-
drivers/scsi/bfa/bfad_bsg.c | 8 +-
drivers/scsi/bfa/bfad_drv.h | 5 +-
drivers/scsi/csiostor/csio_defs.h | 19 +-
drivers/scsi/csiostor/csio_hw.c | 69 ++-
drivers/scsi/csiostor/csio_init.c | 2 +-
drivers/scsi/csiostor/csio_lnode.c | 32 +-
drivers/scsi/csiostor/csio_rnode.c | 28 +-
drivers/scsi/csiostor/csio_scsi.c | 37 +-
fs/afs/file.c | 8 +-
fs/afs/internal.h | 2 +-
fs/exofs/inode.c | 7 +-
fs/fuse/file.c | 4 +-
fs/nfs/dir.c | 5 +-
fs/nfs/read.c | 2 +-
fs/nfs/symlink.c | 6 +-
fs/nfsd/nfs4xdr.c | 556 ++++++++++--------
include/linux/compiler.h | 82 +--
include/linux/compiler_types.h | 4 +
include/linux/linkage.h | 28 +-
include/linux/moduleparam.h | 4 +-
.../linux/netfilter/ipset/ip_set_comment.h | 3 +-
include/linux/pagemap.h | 4 +-
include/linux/syscalls.h | 18 +-
kernel/bpf/core.c | 15 +
kernel/events/core.c | 6 +-
kernel/module.c | 9 +-
kernel/sched/core.c | 4 +-
kernel/sched/deadline.c | 4 +-
kernel/sched/rt.c | 4 +-
kernel/sched/sched.h | 9 +-
mm/filemap.c | 6 +-
mm/readahead.c | 2 +-
net/bridge/br_private.h | 3 +-
net/netfilter/ipset/ip_set_core.c | 3 +-
scripts/Makefile.gcc-plugins | 17 +-
scripts/gcc-plugins/Makefile | 5 +
scripts/gcc-plugins/rap_plugin/Makefile | 6 +
scripts/gcc-plugins/rap_plugin/rap.h | 36 ++
.../gcc-plugins/rap_plugin/rap_fptr_pass.c | 220 +++++++
scripts/gcc-plugins/rap_plugin/rap_hash.c | 382 ++++++++++++
scripts/gcc-plugins/rap_plugin/rap_plugin.c | 534 +++++++++++++++++
scripts/gcc-plugins/rap_plugin/sip.c | 96 +++
security/Kconfig | 18 +
115 files changed, 2511 insertions(+), 753 deletions(-)
create mode 100644 scripts/gcc-plugins/rap_plugin/Makefile
create mode 100644 scripts/gcc-plugins/rap_plugin/rap.h
create mode 100644 scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c
create mode 100644 scripts/gcc-plugins/rap_plugin/rap_hash.c
create mode 100644 scripts/gcc-plugins/rap_plugin/rap_plugin.c
create mode 100644 scripts/gcc-plugins/rap_plugin/sip.c
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
index cb2deb61c5d9..ae85f85a59f4 100644
--- a/arch/x86/crypto/aesni-intel_asm.S
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -1596,7 +1596,7 @@ _esb_loop_\@:
* poly = x^128 + x^127 + x^126 + x^121 + 1
*
*****************************************************************************/
-ENTRY(aesni_gcm_dec)
+RAP_ENTRY(aesni_gcm_dec)
FUNC_SAVE
GCM_INIT %arg6, arg7, arg8, arg9
@@ -1684,7 +1684,7 @@ ENDPROC(aesni_gcm_dec)
*
* poly = x^128 + x^127 + x^126 + x^121 + 1
***************************************************************************/
-ENTRY(aesni_gcm_enc)
+RAP_ENTRY(aesni_gcm_enc)
FUNC_SAVE
GCM_INIT %arg6, arg7, arg8, arg9
@@ -1952,7 +1952,7 @@ ENDPROC(aesni_set_key)
/*
* void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
*/
-ENTRY(aesni_enc)
+RAP_ENTRY(aesni_enc)
FRAME_BEGIN
#ifndef __x86_64__
pushl KEYP
@@ -2143,7 +2143,7 @@ ENDPROC(_aesni_enc4)
/*
* void aesni_dec (struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
*/
-ENTRY(aesni_dec)
+RAP_ENTRY(aesni_dec)
FRAME_BEGIN
#ifndef __x86_64__
pushl KEYP
@@ -2652,7 +2652,7 @@ ENDPROC(_aesni_inc)
* void aesni_ctr_enc(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
* size_t len, u8 *iv)
*/
-ENTRY(aesni_ctr_enc)
+RAP_ENTRY(aesni_ctr_enc)
FRAME_BEGIN
cmp $16, LEN
jb .Lctr_enc_just_ret
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index acbe7e8336d8..8caeaee991ce 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -89,9 +89,9 @@ struct gcm_context_data {
asmlinkage int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
unsigned int key_len);
-asmlinkage void aesni_enc(struct crypto_aes_ctx *ctx, u8 *out,
+asmlinkage void aesni_enc(void *ctx, u8 *out,
const u8 *in);
-asmlinkage void aesni_dec(struct crypto_aes_ctx *ctx, u8 *out,
+asmlinkage void aesni_dec(void *ctx, u8 *out,
const u8 *in);
asmlinkage void aesni_ecb_enc(struct crypto_aes_ctx *ctx, u8 *out,
const u8 *in, unsigned int len);
diff --git a/arch/x86/crypto/blowfish-x86_64-asm_64.S b/arch/x86/crypto/blowfish-x86_64-asm_64.S
index 8c1fcb6bad21..9c229bdd88fa 100644
--- a/arch/x86/crypto/blowfish-x86_64-asm_64.S
+++ b/arch/x86/crypto/blowfish-x86_64-asm_64.S
@@ -156,7 +156,7 @@ ENTRY(__blowfish_enc_blk)
ret;
ENDPROC(__blowfish_enc_blk)
-ENTRY(blowfish_dec_blk)
+RAP_ENTRY(blowfish_dec_blk)
/* input:
* %rdi: ctx
* %rsi: dst
@@ -347,7 +347,7 @@ ENTRY(__blowfish_enc_blk_4way)
ret;
ENDPROC(__blowfish_enc_blk_4way)
-ENTRY(blowfish_dec_blk_4way)
+RAP_ENTRY(blowfish_dec_blk_4way)
/* input:
* %rdi: ctx
* %rsi: dst
diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
index a14af6eb09cb..f24f29149986 100644
--- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
@@ -893,7 +893,7 @@ __camellia_dec_blk16:
jmp .Ldec_max24;
ENDPROC(__camellia_dec_blk16)
-ENTRY(camellia_ecb_enc_16way)
+RAP_ENTRY(camellia_ecb_enc_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -918,7 +918,7 @@ ENTRY(camellia_ecb_enc_16way)
ret;
ENDPROC(camellia_ecb_enc_16way)
-ENTRY(camellia_ecb_dec_16way)
+RAP_ENTRY(camellia_ecb_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -948,7 +948,7 @@ ENTRY(camellia_ecb_dec_16way)
ret;
ENDPROC(camellia_ecb_dec_16way)
-ENTRY(camellia_cbc_dec_16way)
+RAP_ENTRY(camellia_cbc_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -1005,7 +1005,7 @@ ENDPROC(camellia_cbc_dec_16way)
vpslldq $8, tmp, tmp; \
vpsubq tmp, x, x;
-ENTRY(camellia_ctr_16way)
+RAP_ENTRY(camellia_ctr_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -1256,7 +1256,7 @@ camellia_xts_crypt_16way:
ret;
ENDPROC(camellia_xts_crypt_16way)
-ENTRY(camellia_xts_enc_16way)
+RAP_ENTRY(camellia_xts_enc_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -1270,7 +1270,7 @@ ENTRY(camellia_xts_enc_16way)
jmp camellia_xts_crypt_16way;
ENDPROC(camellia_xts_enc_16way)
-ENTRY(camellia_xts_dec_16way)
+RAP_ENTRY(camellia_xts_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
index b66bbfa62f50..10093da32764 100644
--- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
@@ -936,7 +936,7 @@ __camellia_dec_blk32:
jmp .Ldec_max24;
ENDPROC(__camellia_dec_blk32)
-ENTRY(camellia_ecb_enc_32way)
+RAP_ENTRY(camellia_ecb_enc_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
@@ -965,7 +965,7 @@ ENTRY(camellia_ecb_enc_32way)
ret;
ENDPROC(camellia_ecb_enc_32way)
-ENTRY(camellia_ecb_dec_32way)
+RAP_ENTRY(camellia_ecb_dec_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
@@ -999,7 +999,7 @@ ENTRY(camellia_ecb_dec_32way)
ret;
ENDPROC(camellia_ecb_dec_32way)
-ENTRY(camellia_cbc_dec_32way)
+RAP_ENTRY(camellia_cbc_dec_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
@@ -1081,7 +1081,7 @@ ENDPROC(camellia_cbc_dec_32way)
vpslldq $8, tmp1, tmp1; \
vpsubq tmp1, x, x;
-ENTRY(camellia_ctr_32way)
+RAP_ENTRY(camellia_ctr_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
@@ -1374,7 +1374,7 @@ camellia_xts_crypt_32way:
ret;
ENDPROC(camellia_xts_crypt_32way)
-ENTRY(camellia_xts_enc_32way)
+RAP_ENTRY(camellia_xts_enc_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
@@ -1389,7 +1389,7 @@ ENTRY(camellia_xts_enc_32way)
jmp camellia_xts_crypt_32way;
ENDPROC(camellia_xts_enc_32way)
-ENTRY(camellia_xts_dec_32way)
+RAP_ENTRY(camellia_xts_dec_32way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (32 blocks)
diff --git a/arch/x86/crypto/camellia-x86_64-asm_64.S b/arch/x86/crypto/camellia-x86_64-asm_64.S
index 95ba6956a7f6..3d6f034c8ab4 100644
--- a/arch/x86/crypto/camellia-x86_64-asm_64.S
+++ b/arch/x86/crypto/camellia-x86_64-asm_64.S
@@ -237,7 +237,7 @@ ENTRY(__camellia_enc_blk)
ret;
ENDPROC(__camellia_enc_blk)
-ENTRY(camellia_dec_blk)
+RAP_ENTRY(camellia_dec_blk)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -473,7 +473,7 @@ ENTRY(__camellia_enc_blk_2way)
ret;
ENDPROC(__camellia_enc_blk_2way)
-ENTRY(camellia_dec_blk_2way)
+RAP_ENTRY(camellia_dec_blk_2way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
diff --git a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
index 86107c961bb4..529710ebdad0 100644
--- a/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast5-avx-x86_64-asm_64.S
@@ -374,7 +374,7 @@ __cast5_dec_blk16:
jmp .L__dec_tail;
ENDPROC(__cast5_dec_blk16)
-ENTRY(cast5_ecb_enc_16way)
+RAP_ENTRY(cast5_ecb_enc_16way)
/* input:
* %rdi: ctx
* %rsi: dst
@@ -411,7 +411,7 @@ ENTRY(cast5_ecb_enc_16way)
ret;
ENDPROC(cast5_ecb_enc_16way)
-ENTRY(cast5_ecb_dec_16way)
+RAP_ENTRY(cast5_ecb_dec_16way)
/* input:
* %rdi: ctx
* %rsi: dst
diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
index 7f30b6f0d72c..ceea52321dab 100644
--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
@@ -356,7 +356,7 @@ __cast6_dec_blk8:
ret;
ENDPROC(__cast6_dec_blk8)
-ENTRY(cast6_ecb_enc_8way)
+RAP_ENTRY(cast6_ecb_enc_8way)
/* input:
* %rdi: ctx
* %rsi: dst
@@ -379,7 +379,7 @@ ENTRY(cast6_ecb_enc_8way)
ret;
ENDPROC(cast6_ecb_enc_8way)
-ENTRY(cast6_ecb_dec_8way)
+RAP_ENTRY(cast6_ecb_dec_8way)
/* input:
* %rdi: ctx
* %rsi: dst
@@ -402,7 +402,7 @@ ENTRY(cast6_ecb_dec_8way)
ret;
ENDPROC(cast6_ecb_dec_8way)
-ENTRY(cast6_cbc_dec_8way)
+RAP_ENTRY(cast6_cbc_dec_8way)
/* input:
* %rdi: ctx
* %rsi: dst
@@ -428,7 +428,7 @@ ENTRY(cast6_cbc_dec_8way)
ret;
ENDPROC(cast6_cbc_dec_8way)
-ENTRY(cast6_ctr_8way)
+RAP_ENTRY(cast6_ctr_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -456,7 +456,7 @@ ENTRY(cast6_ctr_8way)
ret;
ENDPROC(cast6_ctr_8way)
-ENTRY(cast6_xts_enc_8way)
+RAP_ENTRY(cast6_xts_enc_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -483,7 +483,7 @@ ENTRY(cast6_xts_enc_8way)
ret;
ENDPROC(cast6_xts_enc_8way)
-ENTRY(cast6_xts_dec_8way)
+RAP_ENTRY(cast6_xts_dec_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
diff --git a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
index 2925077f8c6a..38c62f8e9f46 100644
--- a/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/serpent-avx-x86_64-asm_64.S
@@ -677,7 +677,7 @@ __serpent_dec_blk8_avx:
ret;
ENDPROC(__serpent_dec_blk8_avx)
-ENTRY(serpent_ecb_enc_8way_avx)
+RAP_ENTRY(serpent_ecb_enc_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -695,7 +695,7 @@ ENTRY(serpent_ecb_enc_8way_avx)
ret;
ENDPROC(serpent_ecb_enc_8way_avx)
-ENTRY(serpent_ecb_dec_8way_avx)
+RAP_ENTRY(serpent_ecb_dec_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -713,7 +713,7 @@ ENTRY(serpent_ecb_dec_8way_avx)
ret;
ENDPROC(serpent_ecb_dec_8way_avx)
-ENTRY(serpent_cbc_dec_8way_avx)
+RAP_ENTRY(serpent_cbc_dec_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -731,7 +731,7 @@ ENTRY(serpent_cbc_dec_8way_avx)
ret;
ENDPROC(serpent_cbc_dec_8way_avx)
-ENTRY(serpent_ctr_8way_avx)
+RAP_ENTRY(serpent_ctr_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -751,7 +751,7 @@ ENTRY(serpent_ctr_8way_avx)
ret;
ENDPROC(serpent_ctr_8way_avx)
-ENTRY(serpent_xts_enc_8way_avx)
+RAP_ENTRY(serpent_xts_enc_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -773,7 +773,7 @@ ENTRY(serpent_xts_enc_8way_avx)
ret;
ENDPROC(serpent_xts_enc_8way_avx)
-ENTRY(serpent_xts_dec_8way_avx)
+RAP_ENTRY(serpent_xts_dec_8way_avx)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
diff --git a/arch/x86/crypto/serpent-avx2-asm_64.S b/arch/x86/crypto/serpent-avx2-asm_64.S
index d67888f2a52a..1b8c6b456bf5 100644
--- a/arch/x86/crypto/serpent-avx2-asm_64.S
+++ b/arch/x86/crypto/serpent-avx2-asm_64.S
@@ -673,7 +673,7 @@ __serpent_dec_blk16:
ret;
ENDPROC(__serpent_dec_blk16)
-ENTRY(serpent_ecb_enc_16way)
+RAP_ENTRY(serpent_ecb_enc_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -695,7 +695,7 @@ ENTRY(serpent_ecb_enc_16way)
ret;
ENDPROC(serpent_ecb_enc_16way)
-ENTRY(serpent_ecb_dec_16way)
+RAP_ENTRY(serpent_ecb_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -717,7 +717,7 @@ ENTRY(serpent_ecb_dec_16way)
ret;
ENDPROC(serpent_ecb_dec_16way)
-ENTRY(serpent_cbc_dec_16way)
+RAP_ENTRY(serpent_cbc_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -740,7 +740,7 @@ ENTRY(serpent_cbc_dec_16way)
ret;
ENDPROC(serpent_cbc_dec_16way)
-ENTRY(serpent_ctr_16way)
+RAP_ENTRY(serpent_ctr_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -765,7 +765,7 @@ ENTRY(serpent_ctr_16way)
ret;
ENDPROC(serpent_ctr_16way)
-ENTRY(serpent_xts_enc_16way)
+RAP_ENTRY(serpent_xts_enc_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
@@ -791,7 +791,7 @@ ENTRY(serpent_xts_enc_16way)
ret;
ENDPROC(serpent_xts_enc_16way)
-ENTRY(serpent_xts_dec_16way)
+RAP_ENTRY(serpent_xts_dec_16way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst (16 blocks)
diff --git a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
index 7cfba738f104..e077bb6fa7e2 100644
--- a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
+++ b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
@@ -103,7 +103,7 @@ offset = \_offset
# JOB* sha1_mb_mgr_flush_avx2(MB_MGR *state)
# arg 1 : rcx : state
-ENTRY(sha1_mb_mgr_flush_avx2)
+RAP_ENTRY(sha1_mb_mgr_flush_avx2)
FRAME_BEGIN
push %rbx
@@ -226,7 +226,7 @@ ENDPROC(sha1_mb_mgr_flush_avx2)
#################################################################
.align 16
-ENTRY(sha1_mb_mgr_get_comp_job_avx2)
+RAP_ENTRY(sha1_mb_mgr_get_comp_job_avx2)
push %rbx
## if bit 32+3 is set, then all lanes are empty
diff --git a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_submit_avx2.S b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_submit_avx2.S
index 7a93b1c0d69a..7c64e591cf2c 100644
--- a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_submit_avx2.S
+++ b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_submit_avx2.S
@@ -98,7 +98,7 @@ lane_data = %r10
# JOB* submit_mb_mgr_submit_avx2(MB_MGR *state, job_sha1 *job)
# arg 1 : rcx : state
# arg 2 : rdx : job
-ENTRY(sha1_mb_mgr_submit_avx2)
+RAP_ENTRY(sha1_mb_mgr_submit_avx2)
FRAME_BEGIN
push %rbx
push %r12
diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c
index 7391c7de72c7..cdcf6b94f50c 100644
--- a/arch/x86/crypto/sha1_ssse3_glue.c
+++ b/arch/x86/crypto/sha1_ssse3_glue.c
@@ -31,8 +31,8 @@
#include <crypto/sha1_base.h>
#include <asm/fpu/api.h>
-typedef void (sha1_transform_fn)(u32 *digest, const char *data,
- unsigned int rounds);
+typedef void (sha1_transform_fn)(struct sha1_state *digest, const u8 *data,
+ int rounds);
static int sha1_update(struct shash_desc *desc, const u8 *data,
unsigned int len, sha1_transform_fn *sha1_xform)
@@ -47,8 +47,7 @@ static int sha1_update(struct shash_desc *desc, const u8 *data,
BUILD_BUG_ON(offsetof(struct sha1_state, state) != 0);
kernel_fpu_begin();
- sha1_base_do_update(desc, data, len,
- (sha1_block_fn *)sha1_xform);
+ sha1_base_do_update(desc, data, len, sha1_xform);
kernel_fpu_end();
return 0;
@@ -62,29 +61,26 @@ static int sha1_finup(struct shash_desc *desc, const u8 *data,
kernel_fpu_begin();
if (len)
- sha1_base_do_update(desc, data, len,
- (sha1_block_fn *)sha1_xform);
- sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_xform);
+ sha1_base_do_update(desc, data, len, sha1_xform);
+ sha1_base_do_finalize(desc, sha1_xform);
kernel_fpu_end();
return sha1_base_finish(desc, out);
}
-asmlinkage void sha1_transform_ssse3(u32 *digest, const char *data,
- unsigned int rounds);
+asmlinkage void sha1_transform_ssse3(struct sha1_state *digest, const u8 *data,
+ int rounds);
static int sha1_ssse3_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
- return sha1_update(desc, data, len,
- (sha1_transform_fn *) sha1_transform_ssse3);
+ return sha1_update(desc, data, len, sha1_transform_ssse3);
}
static int sha1_ssse3_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
- return sha1_finup(desc, data, len, out,
- (sha1_transform_fn *) sha1_transform_ssse3);
+ return sha1_finup(desc, data, len, out, sha1_transform_ssse3);
}
/* Add padding and return the message digest. */
@@ -123,21 +119,19 @@ static void unregister_sha1_ssse3(void)
}
#ifdef CONFIG_AS_AVX
-asmlinkage void sha1_transform_avx(u32 *digest, const char *data,
- unsigned int rounds);
+asmlinkage void sha1_transform_avx(struct sha1_state *digest, const u8 *data,
+ int rounds);
static int sha1_avx_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
- return sha1_update(desc, data, len,
- (sha1_transform_fn *) sha1_transform_avx);
+ return sha1_update(desc, data, len, sha1_transform_avx);
}
static int sha1_avx_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
- return sha1_finup(desc, data, len, out,
- (sha1_transform_fn *) sha1_transform_avx);
+ return sha1_finup(desc, data, len, out, sha1_transform_avx);
}
static int sha1_avx_final(struct shash_desc *desc, u8 *out)
@@ -194,8 +188,8 @@ static inline void unregister_sha1_avx(void) { }
#if defined(CONFIG_AS_AVX2) && (CONFIG_AS_AVX)
#define SHA1_AVX2_BLOCK_OPTSIZE 4 /* optimal 4*64 bytes of SHA1 blocks */
-asmlinkage void sha1_transform_avx2(u32 *digest, const char *data,
- unsigned int rounds);
+asmlinkage void sha1_transform_avx2(struct sha1_state *digest, const u8 *data,
+ int rounds);
static bool avx2_usable(void)
{
@@ -207,8 +201,8 @@ static bool avx2_usable(void)
return false;
}
-static void sha1_apply_transform_avx2(u32 *digest, const char *data,
- unsigned int rounds)
+static void sha1_apply_transform_avx2(struct sha1_state *digest, const u8 *data,
+ int rounds)
{
/* Select the optimal transform based on data block size */
if (rounds >= SHA1_AVX2_BLOCK_OPTSIZE)
@@ -220,15 +214,13 @@ static void sha1_apply_transform_avx2(u32 *digest, const char *data,
static int sha1_avx2_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
- return sha1_update(desc, data, len,
- (sha1_transform_fn *) sha1_apply_transform_avx2);
+ return sha1_update(desc, data, len, sha1_apply_transform_avx2);
}
static int sha1_avx2_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
- return sha1_finup(desc, data, len, out,
- (sha1_transform_fn *) sha1_apply_transform_avx2);
+ return sha1_finup(desc, data, len, out, sha1_apply_transform_avx2);
}
static int sha1_avx2_final(struct shash_desc *desc, u8 *out)
@@ -271,21 +263,19 @@ static inline void unregister_sha1_avx2(void) { }
#endif
#ifdef CONFIG_AS_SHA1_NI
-asmlinkage void sha1_ni_transform(u32 *digest, const char *data,
- unsigned int rounds);
+asmlinkage void sha1_ni_transform(struct sha1_state *digest, const u8 *data,
+ int rounds);
static int sha1_ni_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
- return sha1_update(desc, data, len,
- (sha1_transform_fn *) sha1_ni_transform);
+ return sha1_update(desc, data, len, sha1_ni_transform);
}
static int sha1_ni_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out)
{
- return sha1_finup(desc, data, len, out,
- (sha1_transform_fn *) sha1_ni_transform);
+ return sha1_finup(desc, data, len, out, sha1_ni_transform);
}
static int sha1_ni_final(struct shash_desc *desc, u8 *out)
diff --git a/arch/x86/crypto/sha256-avx-asm.S b/arch/x86/crypto/sha256-avx-asm.S
index 001bbcf93c79..8fa0448d01d6 100644
--- a/arch/x86/crypto/sha256-avx-asm.S
+++ b/arch/x86/crypto/sha256-avx-asm.S
@@ -347,7 +347,7 @@ a = TMP_
## arg 3 : Num blocks
########################################################################
.text
-ENTRY(sha256_transform_avx)
+RAP_ENTRY(sha256_transform_avx)
.align 32
pushq %rbx
pushq %r12
diff --git a/arch/x86/crypto/sha256-avx2-asm.S b/arch/x86/crypto/sha256-avx2-asm.S
index 1420db15dcdd..e476cdf93b01 100644
--- a/arch/x86/crypto/sha256-avx2-asm.S
+++ b/arch/x86/crypto/sha256-avx2-asm.S
@@ -526,7 +526,7 @@ STACK_SIZE = _RSP + _RSP_SIZE
## arg 3 : Num blocks
########################################################################
.text
-ENTRY(sha256_transform_rorx)
+RAP_ENTRY(sha256_transform_rorx)
.align 32
pushq %rbx
pushq %r12
diff --git a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
index d2364c55bbde..c4e0b3a4e48d 100644
--- a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
+++ b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
@@ -101,7 +101,7 @@ offset = \_offset
# JOB_SHA256* sha256_mb_mgr_flush_avx2(MB_MGR *state)
# arg 1 : rcx : state
-ENTRY(sha256_mb_mgr_flush_avx2)
+RAP_ENTRY(sha256_mb_mgr_flush_avx2)
FRAME_BEGIN
push %rbx
@@ -225,7 +225,7 @@ ENDPROC(sha256_mb_mgr_flush_avx2)
##############################################################################
.align 16
-ENTRY(sha256_mb_mgr_get_comp_job_avx2)
+RAP_ENTRY(sha256_mb_mgr_get_comp_job_avx2)
push %rbx
## if bit 32+3 is set, then all lanes are empty
diff --git a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_submit_avx2.S b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_submit_avx2.S
index b36ae7454084..1a0045bb0fe6 100644
--- a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_submit_avx2.S
+++ b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_submit_avx2.S
@@ -96,7 +96,7 @@ lane_data = %r10
# JOB* sha256_mb_mgr_submit_avx2(MB_MGR *state, JOB_SHA256 *job)
# arg 1 : rcx : state
# arg 2 : rdx : job
-ENTRY(sha256_mb_mgr_submit_avx2)
+RAP_ENTRY(sha256_mb_mgr_submit_avx2)
FRAME_BEGIN
push %rbx
push %r12
diff --git a/arch/x86/crypto/sha256-ssse3-asm.S b/arch/x86/crypto/sha256-ssse3-asm.S
index c6c05ed2c16a..2557f7bec39b 100644
--- a/arch/x86/crypto/sha256-ssse3-asm.S
+++ b/arch/x86/crypto/sha256-ssse3-asm.S
@@ -353,7 +353,7 @@ a = TMP_
## arg 3 : Num blocks
########################################################################
.text
-ENTRY(sha256_transform_ssse3)
+RAP_ENTRY(sha256_transform_ssse3)
.align 32
pushq %rbx
pushq %r12
diff --git a/arch/x86/crypto/sha256_ni_asm.S b/arch/x86/crypto/sha256_ni_asm.S
index fb58f58ecfbc..cf67f3392a82 100644
--- a/arch/x86/crypto/sha256_ni_asm.S
+++ b/arch/x86/crypto/sha256_ni_asm.S
@@ -97,7 +97,7 @@
.text
.align 32
-ENTRY(sha256_ni_transform)
+RAP_ENTRY(sha256_ni_transform)
shl $6, NUM_BLKS /* convert to bytes */
jz .Ldone_hash
diff --git a/arch/x86/crypto/sha256_ssse3_glue.c b/arch/x86/crypto/sha256_ssse3_glue.c
index 773a873d2b28..ec5788726078 100644
--- a/arch/x86/crypto/sha256_ssse3_glue.c
+++ b/arch/x86/crypto/sha256_ssse3_glue.c
@@ -40,9 +40,9 @@
#include <asm/fpu/api.h>
#include <linux/string.h>
-asmlinkage void sha256_transform_ssse3(u32 *digest, const char *data,
- u64 rounds);
-typedef void (sha256_transform_fn)(u32 *digest, const char *data, u64 rounds);
+asmlinkage void sha256_transform_ssse3(struct sha256_state *digest, const u8 *data,
+ int rounds);
+typedef void (sha256_transform_fn)(struct sha256_state *digest, const u8 *data, int rounds);
static int sha256_update(struct shash_desc *desc, const u8 *data,
unsigned int len, sha256_transform_fn *sha256_xform)
@@ -57,8 +57,7 @@ static int sha256_update(struct shash_desc *desc, const u8 *data,
BUILD_BUG_ON(offsetof(struct sha256_state, state) != 0);
kernel_fpu_begin();
- sha256_base_do_update(desc, data, len,
- (sha256_block_fn *)sha256_xform);
+ sha256_base_do_update(desc, data, len, sha256_xform);
kernel_fpu_end();
return 0;
@@ -72,9 +71,8 @@ static int sha256_finup(struct shash_desc *desc, const u8 *data,
kernel_fpu_begin();
if (len)
- sha256_base_do_update(desc, data, len,
- (sha256_block_fn *)sha256_xform);
- sha256_base_do_finalize(desc, (sha256_block_fn *)sha256_xform);
+ sha256_base_do_update(desc, data, len, sha256_xform);
+ sha256_base_do_finalize(desc, sha256_xform);
kernel_fpu_end();
return sha256_base_finish(desc, out);
@@ -144,8 +142,8 @@ static void unregister_sha256_ssse3(void)
}
#ifdef CONFIG_AS_AVX
-asmlinkage void sha256_transform_avx(u32 *digest, const char *data,
- u64 rounds);
+asmlinkage void sha256_transform_avx(struct sha256_state *digest, const u8 *data,
+ int rounds);
static int sha256_avx_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
@@ -226,8 +224,8 @@ static inline void unregister_sha256_avx(void) { }
#endif
#if defined(CONFIG_AS_AVX2) && defined(CONFIG_AS_AVX)
-asmlinkage void sha256_transform_rorx(u32 *digest, const char *data,
- u64 rounds);
+asmlinkage void sha256_transform_rorx(struct sha256_state *digest, const u8 *data,
+ int rounds);
static int sha256_avx2_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
@@ -306,8 +304,8 @@ static inline void unregister_sha256_avx2(void) { }
#endif
#ifdef CONFIG_AS_SHA256_NI
-asmlinkage void sha256_ni_transform(u32 *digest, const char *data,
- u64 rounds); /*unsigned int rounds);*/
+asmlinkage void sha256_ni_transform(struct sha256_state *digest, const u8 *data,
+ int rounds); /*unsigned int rounds);*/
static int sha256_ni_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
diff --git a/arch/x86/crypto/sha512-avx-asm.S b/arch/x86/crypto/sha512-avx-asm.S
index 39235fefe6f7..7e51f52b74c1 100644
--- a/arch/x86/crypto/sha512-avx-asm.S
+++ b/arch/x86/crypto/sha512-avx-asm.S
@@ -277,7 +277,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
# message blocks.
# L is the message length in SHA512 blocks
########################################################################
-ENTRY(sha512_transform_avx)
+RAP_ENTRY(sha512_transform_avx)
cmp $0, msglen
je nowork
diff --git a/arch/x86/crypto/sha512-avx2-asm.S b/arch/x86/crypto/sha512-avx2-asm.S
index b16d56005162..dbfb27b92b51 100644
--- a/arch/x86/crypto/sha512-avx2-asm.S
+++ b/arch/x86/crypto/sha512-avx2-asm.S
@@ -569,7 +569,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
# message blocks.
# L is the message length in SHA512 blocks
########################################################################
-ENTRY(sha512_transform_rorx)
+RAP_ENTRY(sha512_transform_rorx)
# Allocate Stack Space
mov %rsp, %rax
sub $frame_size, %rsp
diff --git a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_flush_avx2.S
index 7c629caebc05..ebf3d77941f9 100644
--- a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_flush_avx2.S
+++ b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_flush_avx2.S
@@ -107,7 +107,7 @@ offset = \_offset
# JOB* sha512_mb_mgr_flush_avx2(MB_MGR *state)
# arg 1 : rcx : state
-ENTRY(sha512_mb_mgr_flush_avx2)
+RAP_ENTRY(sha512_mb_mgr_flush_avx2)
FRAME_BEGIN
push %rbx
@@ -220,7 +220,7 @@ return_null:
ENDPROC(sha512_mb_mgr_flush_avx2)
.align 16
-ENTRY(sha512_mb_mgr_get_comp_job_avx2)
+RAP_ENTRY(sha512_mb_mgr_get_comp_job_avx2)
push %rbx
mov _unused_lanes(state), unused_lanes
diff --git a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_submit_avx2.S b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_submit_avx2.S
index 4ba709ba78e5..8730bfd3b08e 100644
--- a/arch/x86/crypto/sha512-mb/sha512_mb_mgr_submit_avx2.S
+++ b/arch/x86/crypto/sha512-mb/sha512_mb_mgr_submit_avx2.S
@@ -98,7 +98,7 @@
# JOB* sha512_mb_mgr_submit_avx2(MB_MGR *state, JOB *job)
# arg 1 : rcx : state
# arg 2 : rdx : job
-ENTRY(sha512_mb_mgr_submit_avx2)
+RAP_ENTRY(sha512_mb_mgr_submit_avx2)
FRAME_BEGIN
push %rbx
push %r12
diff --git a/arch/x86/crypto/sha512-ssse3-asm.S b/arch/x86/crypto/sha512-ssse3-asm.S
index 66bbd9058a90..4d2e909255e0 100644
--- a/arch/x86/crypto/sha512-ssse3-asm.S
+++ b/arch/x86/crypto/sha512-ssse3-asm.S
@@ -275,7 +275,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
# message blocks.
# L is the message length in SHA512 blocks.
########################################################################
-ENTRY(sha512_transform_ssse3)
+RAP_ENTRY(sha512_transform_ssse3)
cmp $0, msglen
je nowork
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
index 73b471da3622..eb9ca636fba6 100644
--- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S
@@ -330,7 +330,7 @@ __twofish_dec_blk8:
ret;
ENDPROC(__twofish_dec_blk8)
-ENTRY(twofish_ecb_enc_8way)
+RAP_ENTRY(twofish_ecb_enc_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -350,7 +350,7 @@ ENTRY(twofish_ecb_enc_8way)
ret;
ENDPROC(twofish_ecb_enc_8way)
-ENTRY(twofish_ecb_dec_8way)
+RAP_ENTRY(twofish_ecb_dec_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -370,7 +370,7 @@ ENTRY(twofish_ecb_dec_8way)
ret;
ENDPROC(twofish_ecb_dec_8way)
-ENTRY(twofish_cbc_dec_8way)
+RAP_ENTRY(twofish_cbc_dec_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -395,7 +395,7 @@ ENTRY(twofish_cbc_dec_8way)
ret;
ENDPROC(twofish_cbc_dec_8way)
-ENTRY(twofish_ctr_8way)
+RAP_ENTRY(twofish_ctr_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -422,7 +422,7 @@ ENTRY(twofish_ctr_8way)
ret;
ENDPROC(twofish_ctr_8way)
-ENTRY(twofish_xts_enc_8way)
+RAP_ENTRY(twofish_xts_enc_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
@@ -446,7 +446,7 @@ ENTRY(twofish_xts_enc_8way)
ret;
ENDPROC(twofish_xts_enc_8way)
-ENTRY(twofish_xts_dec_8way)
+RAP_ENTRY(twofish_xts_dec_8way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
diff --git a/arch/x86/crypto/twofish-i586-asm_32.S b/arch/x86/crypto/twofish-i586-asm_32.S
index 694ea4587ba7..f2c141827d3d 100644
--- a/arch/x86/crypto/twofish-i586-asm_32.S
+++ b/arch/x86/crypto/twofish-i586-asm_32.S
@@ -220,7 +220,7 @@
xor %esi, d ## D;\
ror $1, d ## D;
-ENTRY(twofish_enc_blk)
+RAP_ENTRY(twofish_enc_blk)
push %ebp /* save registers according to calling convention*/
push %ebx
push %esi
@@ -276,7 +276,7 @@ ENTRY(twofish_enc_blk)
ret
ENDPROC(twofish_enc_blk)
-ENTRY(twofish_dec_blk)
+RAP_ENTRY(twofish_dec_blk)
push %ebp /* save registers according to calling convention*/
push %ebx
push %esi
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
index e7273a606a07..dd44bac7849a 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
@@ -284,7 +284,7 @@ ENTRY(__twofish_enc_blk_3way)
ret;
ENDPROC(__twofish_enc_blk_3way)
-ENTRY(twofish_dec_blk_3way)
+RAP_ENTRY(twofish_dec_blk_3way)
/* input:
* %rdi: ctx, CTX
* %rsi: dst
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
index a350c990dc86..32a5e60c152e 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64.S
@@ -215,7 +215,7 @@
xor %r8d, d ## D;\
ror $1, d ## D;
-ENTRY(twofish_enc_blk)
+RAP_ENTRY(twofish_enc_blk)
pushq R1
/* %rdi contains the ctx address */
@@ -268,7 +268,7 @@ ENTRY(twofish_enc_blk)
ret
ENDPROC(twofish_enc_blk)
-ENTRY(twofish_dec_blk)
+RAP_ENTRY(twofish_dec_blk)
pushq R1
/* %rdi contains the ctx address */
diff --git a/arch/x86/entry/Makefile b/arch/x86/entry/Makefile
index 06fc70cf5433..03f475583296 100644
--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -15,3 +15,5 @@ obj-y += vsyscall/
obj-$(CONFIG_IA32_EMULATION) += entry_64_compat.o syscall_32.o
+CFLAGS_REMOVE_syscall_32.o = $(RAP_PLUGIN_ABS_CFLAGS)
+CFLAGS_REMOVE_syscall_64.o = $(RAP_PLUGIN_ABS_CFLAGS)
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 3b2490b81918..0806da8cdb62 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -287,7 +287,17 @@ __visible void do_syscall_64(unsigned long nr, struct pt_regs *regs)
nr &= __SYSCALL_MASK;
if (likely(nr < NR_syscalls)) {
nr = array_index_nospec(nr, NR_syscalls);
+#ifdef CONFIG_PAX_RAP
+ asm volatile("movq %[param],%%rdi\n\t"
+ "call *%P[syscall]\n\t"
+ "mov %%rax,%[result]\n\t"
+ : [result] "=m" (regs->ax)
+ : [syscall] "m" (sys_call_table[nr]),
+ [param] "m" (regs)
+ : "ax", "di", "memory");
+#else
regs->ax = sys_call_table[nr](regs);
+#endif
}
syscall_return_slowpath(regs);
@@ -331,10 +341,51 @@ static __always_inline void do_syscall_32_irqs_on(struct pt_regs *regs)
* the high bits are zero. Make sure we zero-extend all
* of the args.
*/
+#ifdef CONFIG_PAX_RAP
+#ifdef CONFIG_X86_64
+ asm volatile("movl %[param1],%%edi\n\t"
+ "movl %[param2],%%esi\n\t"
+ "movl %[param3],%%edx\n\t"
+ "movl %[param4],%%ecx\n\t"
+ "movl %[param5],%%r8d\n\t"
+ "movl %[param6],%%r9d\n\t"
+ "call *%P[syscall]\n\t"
+ "mov %%rax,%[result]\n\t"
+ : [result] "=m" (regs->ax)
+ : [syscall] "m" (ia32_sys_call_table[nr]),
+ [param1] "m" (regs->bx),
+ [param2] "m" (regs->cx),
+ [param3] "m" (regs->dx),
+ [param4] "m" (regs->si),
+ [param5] "m" (regs->di),
+ [param6] "m" (regs->bp)
+ : "ax", "di", "si", "dx", "cx", "r8", "r9", "r10", "r11", "memory");
+#else
+ asm volatile("pushl %[param6]\n\t"
+ "pushl %[param5]\n\t"
+ "pushl %[param4]\n\t"
+ "pushl %[param3]\n\t"
+ "pushl %[param2]\n\t"
+ "pushl %[param1]\n\t"
+ "call *%P[syscall]\n\t"
+ "addl $6*8,%%esp\n\t"
+ "mov %%eax,%[result]\n\t"
+ : [result] "=m" (regs->ax)
+ : [syscall] "m" (ia32_sys_call_table[nr]),
+ [param1] "m" (regs->bx),
+ [param2] "m" (regs->cx),
+ [param3] "m" (regs->dx),
+ [param4] "m" (regs->si),
+ [param5] "m" (regs->di),
+ [param6] "m" (regs->bp)
+ : "ax", "dx", "cx", "memory");
+#endif
+#else
regs->ax = ia32_sys_call_table[nr](
(unsigned int)regs->bx, (unsigned int)regs->cx,
(unsigned int)regs->dx, (unsigned int)regs->si,
(unsigned int)regs->di, (unsigned int)regs->bp);
+#endif
#endif /* CONFIG_IA32_EMULATION */
}
diff --git a/arch/x86/events/amd/iommu.h b/arch/x86/events/amd/iommu.h
index 62e0702c4374..bc87ec5647c0 100644
--- a/arch/x86/events/amd/iommu.h
+++ b/arch/x86/events/amd/iommu.h
@@ -41,6 +41,6 @@ extern int amd_iommu_pc_set_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
extern int amd_iommu_pc_get_reg(struct amd_iommu *iommu, u8 bank, u8 cntr,
u8 fxn, u64 *value);
-extern struct amd_iommu *get_amd_iommu(int idx);
+extern struct amd_iommu *get_amd_iommu(unsigned int idx);
#endif /*_PERF_EVENT_AMD_IOMMU_H_*/
diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h
index 62be73b23d5c..4133797d4274 100644
--- a/arch/x86/include/asm/e820/api.h
+++ b/arch/x86/include/asm/e820/api.h
@@ -11,7 +11,7 @@ extern struct e820_table *e820_table_firmware;
extern unsigned long pci_mem_start;
extern bool e820__mapped_any(u64 start, u64 end, enum e820_type type);
-extern bool e820__mapped_all(u64 start, u64 end, enum e820_type type);
+extern bool e820__mapped_all(u64 start, u64 end, unsigned type);
extern void e820__range_add (u64 start, u64 size, enum e820_type type);
extern u64 e820__range_update(u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 6390bd8c141b..de014caebfe8 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -159,7 +159,7 @@ extern pte_t *kmap_pte;
extern pte_t *pkmap_page_table;
void __native_set_fixmap(enum fixed_addresses idx, pte_t pte);
-void native_set_fixmap(enum fixed_addresses idx,
+void native_set_fixmap(unsigned int idx,
phys_addr_t phys, pgprot_t flags);
#ifndef CONFIG_PARAVIRT
diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
index 7948a17febb4..bc2b010b3d76 100644
--- a/arch/x86/include/asm/module.h
+++ b/arch/x86/include/asm/module.h
@@ -15,6 +15,7 @@ struct mod_arch_specific {
#ifdef CONFIG_X86_64
/* X86_64 does not define MODULE_PROC_FAMILY */
+#define MODULE_PROC_FAMILY ""
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif defined CONFIG_M586
@@ -67,8 +68,12 @@ struct mod_arch_specific {
#error unknown processor family
#endif
-#ifdef CONFIG_X86_32
-# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
+#ifdef CONFIG_PAX_RAP
+#define MODULE_PAX_RAP "RAP "
+#else
+#define MODULE_PAX_RAP ""
#endif
+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_RAP
+
#endif /* _ASM_X86_MODULE_H */
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 3aac91ca8909..fb9d908784a6 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -292,11 +292,17 @@ static __init int activate_jump_labels(void)
}
arch_initcall(activate_jump_labels);
+/*
+ * No need for any "IO delay" on VMware hypervisor
+ */
+static void vmware_io_delay(void)
+{
+}
static void __init vmware_paravirt_ops_setup(void)
{
pv_info.name = "VMware hypervisor";
- pv_cpu_ops.io_delay = paravirt_nop;
+ pv_cpu_ops.io_delay = vmware_io_delay;
if (vmware_tsc_khz == 0)
return;
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index c88c23c658c1..7a0b8f22ced5 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -132,7 +132,7 @@ static struct e820_entry *__e820__mapped_all(u64 start, u64 end,
/*
* This function checks if the entire range <start,end> is mapped with type.
*/
-bool __init e820__mapped_all(u64 start, u64 end, enum e820_type type)
+bool __init e820__mapped_all(u64 start, u64 end, unsigned type)
{
return __e820__mapped_all(start, end, type);
}
diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index 91b2cff4b79a..7aeca3f7541c 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -186,7 +186,7 @@ GLOBAL(ftrace_graph_call)
#endif
/* This is weak to keep gas from relaxing the jumps */
-WEAK(ftrace_stub)
+RAP_WEAK(ftrace_stub)
retq
ENDPROC(ftrace_caller)
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 8dc69d82567e..6cc82b588318 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -399,6 +399,10 @@ NOKPROBE_SYMBOL(native_load_idt);
#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64)
#endif
+void tlb_remove_page_wrapper(struct mmu_gather *tlb, void *table) {
+ tlb_remove_page(tlb, (struct page *)table);
+}
+
struct pv_mmu_ops pv_mmu_ops __ro_after_init = {
.read_cr2 = native_read_cr2,
@@ -410,7 +414,7 @@ struct pv_mmu_ops pv_mmu_ops __ro_after_init = {
.flush_tlb_kernel = native_flush_tlb_global,
.flush_tlb_one_user = native_flush_tlb_one_user,
.flush_tlb_others = native_flush_tlb_others,
- .tlb_remove_table = (void (*)(struct mmu_gather *, void *))tlb_remove_page,
+ .tlb_remove_table = tlb_remove_page_wrapper,
.pgd_alloc = __paravirt_pgd_alloc,
.pgd_free = paravirt_nop,
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index e6db475164ed..3be5161ac26c 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -211,6 +211,10 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str,
tsk->thread.error_code = error_code;
tsk->thread.trap_nr = trapnr;
+#ifdef CONFIG_PAX_RAP
+ if (trapnr == X86_TRAP_UD)
+ str = "PAX: overwritten function pointer or return address detected";
+#endif
die(str, regs, error_code);
}
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 59274e2c1ac4..2428f9d132cf 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -660,7 +660,7 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
fixmaps_set++;
}
-void native_set_fixmap(enum fixed_addresses idx, phys_addr_t phys,
+void native_set_fixmap(unsigned int idx, phys_addr_t phys,
pgprot_t flags)
{
/* Sanitize 'prot' against any unsupported bits: */
diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 8019edd0125c..1ce29074f0e0 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -18,7 +18,7 @@
* event status with one and operation. If there are pending events,
* then enter the hypervisor to get them handled.
*/
-ENTRY(xen_irq_enable_direct)
+RAP_ENTRY(xen_irq_enable_direct)
FRAME_BEGIN
/* Unmask events */
movb $0, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
@@ -44,7 +44,7 @@ ENTRY(xen_irq_enable_direct)
* Disabling events is simply a matter of making the event mask
* non-zero.
*/
-ENTRY(xen_irq_disable_direct)
+RAP_ENTRY(xen_irq_disable_direct)
movb $1, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
ret
ENDPROC(xen_irq_disable_direct)
@@ -58,7 +58,7 @@ ENDPROC(xen_irq_disable_direct)
* undefined. We need to toggle the state of the bit, because Xen and
* x86 use opposite senses (mask vs enable).
*/
-ENTRY(xen_save_fl_direct)
+RAP_ENTRY(xen_save_fl_direct)
testb $0xff, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
setz %ah
addb %ah, %ah
@@ -73,7 +73,7 @@ ENTRY(xen_save_fl_direct)
* interrupt mask state, it checks for unmasked pending events and
* enters the hypervisor to get them delivered if so.
*/
-ENTRY(xen_restore_fl_direct)
+RAP_ENTRY(xen_restore_fl_direct)
FRAME_BEGIN
#ifdef CONFIG_X86_64
testw $X86_EFLAGS_IF, %di
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 46caadca916a..deb6a2bcb730 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -296,6 +296,11 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
}
EXPORT_SYMBOL_GPL(tpm_chip_alloc);
+static void tpm_put_device(void *dev)
+{
+ put_device(dev);
+}
+
/**
* tpmm_chip_alloc() - allocate a new struct tpm_chip instance
* @pdev: parent device to which the chip is associated
@@ -313,9 +318,7 @@ struct tpm_chip *tpmm_chip_alloc(struct device *pdev,
if (IS_ERR(chip))
return chip;
- rc = devm_add_action_or_reset(pdev,
- (void (*)(void *)) put_device,
- &chip->dev);
+ rc = devm_add_action_or_reset(pdev, tpm_put_device, &chip->dev);
if (rc)
return ERR_PTR(rc);
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 624a11cb07e2..3ddff56fec99 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -161,9 +161,14 @@ static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0;
}
+static void dmi_dev_release(struct device *dev)
+{
+ kfree(dev);
+}
+
static struct class dmi_class = {
.name = "dmi",
- .dev_release = (void(*)(struct device *)) kfree,
+ .dev_release = dmi_dev_release,
.dev_uevent = dmi_dev_uevent,
};
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
index 7deb81b6dbac..bb22bc27a9be 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
@@ -154,11 +154,16 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name)
return (void *)fw;
}
+static void shadow_fw_fini(void *fw)
+{
+ release_firmware(fw);
+}
+
static const struct nvbios_source
shadow_fw = {
.name = "firmware",
.init = shadow_fw_init,
- .fini = (void(*)(void *))release_firmware,
+ .fini = shadow_fw_fini,
.read = shadow_fw_read,
.rw = false,
};
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
index 9b91da09dc5f..b3fa90d37fd1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
@@ -111,11 +111,16 @@ platform_init(struct nvkm_bios *bios, const char *name)
return ERR_PTR(ret);
}
+static void platform_fini(void *data)
+{
+ kfree(data);
+}
+
const struct nvbios_source
nvbios_platform = {
.name = "PLATFORM",
.init = platform_init,
- .fini = (void(*)(void *))kfree,
+ .fini = platform_fini,
.read = pcirom_read,
.rw = true,
};
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index dec1e081f529..631f91c883c5 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -833,7 +833,7 @@ u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe)
* Enable the interrupt on the requested crtc (all asics).
* Returns 0 on success, -EINVAL on failure.
*/
-int radeon_enable_vblank_kms(struct drm_device *dev, int crtc)
+int radeon_enable_vblank_kms(struct drm_device *dev, unsigned int crtc)
{
struct radeon_device *rdev = dev->dev_private;
unsigned long irqflags;
@@ -859,7 +859,7 @@ int radeon_enable_vblank_kms(struct drm_device *dev, int crtc)
*
* Disable the interrupt on the requested crtc (all asics).
*/
-void radeon_disable_vblank_kms(struct drm_device *dev, int crtc)
+void radeon_disable_vblank_kms(struct drm_device *dev, unsigned int crtc)
{
struct radeon_device *rdev = dev->dev_private;
unsigned long irqflags;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 98d4c5a3ff21..b2e8cbda6e51 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -5615,7 +5615,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy,
return 0;
}
-static int bnx2x_link_settings_status(struct bnx2x_phy *phy,
+static u8 bnx2x_link_settings_status(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -5689,7 +5689,7 @@ static int bnx2x_link_settings_status(struct bnx2x_phy *phy,
return rc;
}
-static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy,
+static u8 bnx2x_warpcore_read_status(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -7368,7 +7368,7 @@ static void bnx2x_8073_specific_func(struct bnx2x_phy *phy,
}
}
-static int bnx2x_8073_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8073_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -7431,7 +7431,7 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy,
if (params->loopback_mode == LOOPBACK_EXT) {
bnx2x_807x_force_10G(bp, phy);
DP(NETIF_MSG_LINK, "Forced speed 10G on 807X\n");
- return 0;
+ return;
} else {
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_BCM_CTRL, 0x0002);
@@ -7513,7 +7513,6 @@ static int bnx2x_8073_config_init(struct bnx2x_phy *phy,
bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0x1200);
DP(NETIF_MSG_LINK, "807x Autoneg Restart: Advertise 1G=%x, 10G=%x\n",
((val & (1<<5)) > 0), ((val & (1<<7)) > 0));
- return 0;
}
static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy,
@@ -7680,7 +7679,7 @@ static void bnx2x_8073_link_reset(struct bnx2x_phy *phy,
/******************************************************************/
/* BCM8705 PHY SECTION */
/******************************************************************/
-static int bnx2x_8705_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8705_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -7704,7 +7703,6 @@ static int bnx2x_8705_config_init(struct bnx2x_phy *phy,
MDIO_WIS_DEVAD, MDIO_WIS_REG_LASI_CNTL, 0x1);
/* BCM8705 doesn't have microcode, hence the 0 */
bnx2x_save_spirom_version(bp, params->port, params->shmem_base, 0);
- return 0;
}
static u8 bnx2x_8705_read_status(struct bnx2x_phy *phy,
@@ -8891,7 +8889,7 @@ static u8 bnx2x_8706_8726_read_status(struct bnx2x_phy *phy,
/******************************************************************/
/* BCM8706 PHY SECTION */
/******************************************************************/
-static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8706_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -8993,11 +8991,9 @@ static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy,
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_DIGITAL_CTRL, tmp1);
}
-
- return 0;
}
-static int bnx2x_8706_read_status(struct bnx2x_phy *phy,
+static u8 bnx2x_8706_read_status(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -9074,7 +9070,7 @@ static u8 bnx2x_8726_read_status(struct bnx2x_phy *phy,
}
-static int bnx2x_8726_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8726_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -9155,8 +9151,6 @@ static int bnx2x_8726_config_init(struct bnx2x_phy *phy,
phy->tx_preemphasis[1]);
}
- return 0;
-
}
static void bnx2x_8726_link_reset(struct bnx2x_phy *phy,
@@ -9292,7 +9286,7 @@ static void bnx2x_8727_config_speed(struct bnx2x_phy *phy,
}
}
-static int bnx2x_8727_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8727_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -9374,8 +9368,6 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_PHY_IDENTIFIER,
(tmp2 & 0x7fff));
}
-
- return 0;
}
static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy,
@@ -9950,7 +9942,7 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy,
return 0;
}
-static int bnx2x_8481_config_init(struct bnx2x_phy *phy,
+static void bnx2x_8481_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -9964,7 +9956,7 @@ static int bnx2x_8481_config_init(struct bnx2x_phy *phy,
bnx2x_wait_reset_complete(bp, phy, params);
bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15);
- return bnx2x_848xx_cmn_config_init(phy, params, vars);
+ bnx2x_848xx_cmn_config_init(phy, params, vars);
}
#define PHY848xx_CMDHDLR_WAIT 300
@@ -10214,7 +10206,7 @@ static u8 bnx2x_84833_get_reset_gpios(struct bnx2x *bp,
return reset_gpios;
}
-static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
+static void bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
struct link_params *params)
{
struct bnx2x *bp = params->bp;
@@ -10243,8 +10235,6 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy *phy,
udelay(10);
DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n",
reset_gpios);
-
- return 0;
}
static int bnx2x_8483x_disable_eee(struct bnx2x_phy *phy,
@@ -10287,7 +10277,7 @@ static int bnx2x_8483x_enable_eee(struct bnx2x_phy *phy,
}
#define PHY84833_CONSTANT_LATENCY 1193
-static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
+static void bnx2x_848x3_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -10434,7 +10424,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
if (rc) {
DP(NETIF_MSG_LINK, "Failed to configure EEE timers\n");
bnx2x_8483x_disable_eee(phy, params, vars);
- return rc;
+ return;
}
if ((phy->req_duplex == DUPLEX_FULL) &&
@@ -10446,7 +10436,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
rc = bnx2x_8483x_disable_eee(phy, params, vars);
if (rc) {
DP(NETIF_MSG_LINK, "Failed to set EEE advertisement\n");
- return rc;
+ return;
}
} else {
vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK;
@@ -10485,7 +10475,6 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
MDIO_84833_TOP_CFG_XGPHY_STRAP1,
(u16)~MDIO_84833_SUPER_ISOLATE);
}
- return rc;
}
static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy,
@@ -11042,7 +11031,7 @@ static void bnx2x_54618se_specific_func(struct bnx2x_phy *phy,
}
}
-static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
+static void bnx2x_54618se_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -11244,8 +11233,6 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy,
bnx2x_cl22_write(bp, phy,
MDIO_PMA_REG_CTRL, autoneg_val);
-
- return 0;
}
@@ -11469,7 +11456,7 @@ static void bnx2x_7101_config_loopback(struct bnx2x_phy *phy,
MDIO_XS_DEVAD, MDIO_XS_SFX7101_XGXS_TEST1, 0x100);
}
-static int bnx2x_7101_config_init(struct bnx2x_phy *phy,
+static void bnx2x_7101_config_init(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars)
{
@@ -11506,7 +11493,6 @@ static int bnx2x_7101_config_init(struct bnx2x_phy *phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_7101_VER2, &fw_ver2);
bnx2x_save_spirom_version(bp, params->port,
(u32)(fw_ver1<<16 | fw_ver2), phy->ver_addr);
- return 0;
}
static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy,
@@ -11675,9 +11661,9 @@ static const struct bnx2x_phy phy_serdes = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_xgxs_config_init,
- .read_status = (read_status_t)bnx2x_link_settings_status,
- .link_reset = (link_reset_t)bnx2x_int_link_reset,
+ .config_init = bnx2x_xgxs_config_init,
+ .read_status = bnx2x_link_settings_status,
+ .link_reset = bnx2x_int_link_reset,
.config_loopback = (config_loopback_t)NULL,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
@@ -11711,14 +11697,14 @@ static const struct bnx2x_phy phy_xgxs = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_xgxs_config_init,
- .read_status = (read_status_t)bnx2x_link_settings_status,
- .link_reset = (link_reset_t)bnx2x_int_link_reset,
- .config_loopback = (config_loopback_t)bnx2x_set_xgxs_loopback,
+ .config_init = bnx2x_xgxs_config_init,
+ .read_status = bnx2x_link_settings_status,
+ .link_reset = bnx2x_int_link_reset,
+ .config_loopback = bnx2x_set_xgxs_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
- .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func
+ .phy_specific_func = bnx2x_xgxs_specific_func
};
static const struct bnx2x_phy phy_warpcore = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
@@ -11749,12 +11735,12 @@ static const struct bnx2x_phy phy_warpcore = {
.speed_cap_mask = 0,
/* req_duplex = */0,
/* rsrv = */0,
- .config_init = (config_init_t)bnx2x_warpcore_config_init,
- .read_status = (read_status_t)bnx2x_warpcore_read_status,
- .link_reset = (link_reset_t)bnx2x_warpcore_link_reset,
- .config_loopback = (config_loopback_t)bnx2x_set_warpcore_loopback,
+ .config_init = bnx2x_warpcore_config_init,
+ .read_status = bnx2x_warpcore_read_status,
+ .link_reset = bnx2x_warpcore_link_reset,
+ .config_loopback = bnx2x_set_warpcore_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
- .hw_reset = (hw_reset_t)bnx2x_warpcore_hw_reset,
+ .hw_reset = bnx2x_warpcore_hw_reset,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
};
@@ -11780,13 +11766,13 @@ static const struct bnx2x_phy phy_7101 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_7101_config_init,
- .read_status = (read_status_t)bnx2x_7101_read_status,
- .link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
- .config_loopback = (config_loopback_t)bnx2x_7101_config_loopback,
- .format_fw_ver = (format_fw_ver_t)bnx2x_7101_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_7101_hw_reset,
- .set_link_led = (set_link_led_t)bnx2x_7101_set_link_led,
+ .config_init = bnx2x_7101_config_init,
+ .read_status = bnx2x_7101_read_status,
+ .link_reset = bnx2x_common_ext_link_reset,
+ .config_loopback = bnx2x_7101_config_loopback,
+ .format_fw_ver = bnx2x_7101_format_ver,
+ .hw_reset = bnx2x_7101_hw_reset,
+ .set_link_led = bnx2x_7101_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL
};
static const struct bnx2x_phy phy_8073 = {
@@ -11811,14 +11797,14 @@ static const struct bnx2x_phy phy_8073 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8073_config_init,
- .read_status = (read_status_t)bnx2x_8073_read_status,
- .link_reset = (link_reset_t)bnx2x_8073_link_reset,
+ .config_init = bnx2x_8073_config_init,
+ .read_status = bnx2x_8073_read_status,
+ .link_reset = bnx2x_8073_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
+ .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
- .phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func
+ .phy_specific_func = bnx2x_8073_specific_func
};
static const struct bnx2x_phy phy_8705 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,
@@ -11839,11 +11825,11 @@ static const struct bnx2x_phy phy_8705 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8705_config_init,
- .read_status = (read_status_t)bnx2x_8705_read_status,
- .link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
+ .config_init = bnx2x_8705_config_init,
+ .read_status = bnx2x_8705_read_status,
+ .link_reset = bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_null_format_ver,
+ .format_fw_ver = bnx2x_null_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
@@ -11868,11 +11854,11 @@ static const struct bnx2x_phy phy_8706 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8706_config_init,
- .read_status = (read_status_t)bnx2x_8706_read_status,
- .link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
+ .config_init = bnx2x_8706_config_init,
+ .read_status = bnx2x_8706_read_status,
+ .link_reset = bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
+ .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
@@ -11900,11 +11886,11 @@ static const struct bnx2x_phy phy_8726 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8726_config_init,
- .read_status = (read_status_t)bnx2x_8726_read_status,
- .link_reset = (link_reset_t)bnx2x_8726_link_reset,
- .config_loopback = (config_loopback_t)bnx2x_8726_config_loopback,
- .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
+ .config_init = bnx2x_8726_config_init,
+ .read_status = bnx2x_8726_read_status,
+ .link_reset = bnx2x_8726_link_reset,
+ .config_loopback = bnx2x_8726_config_loopback,
+ .format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
@@ -11931,14 +11917,14 @@ static const struct bnx2x_phy phy_8727 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8727_config_init,
- .read_status = (read_status_t)bnx2x_8727_read_status,
- .link_reset = (link_reset_t)bnx2x_8727_link_reset,
+ .config_init = bnx2x_8727_config_init,
+ .read_status = bnx2x_8727_read_status,
+ .link_reset = bnx2x_8727_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_8727_hw_reset,
- .set_link_led = (set_link_led_t)bnx2x_8727_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func
+ .format_fw_ver = bnx2x_format_ver,
+ .hw_reset = bnx2x_8727_hw_reset,
+ .set_link_led = bnx2x_8727_set_link_led,
+ .phy_specific_func = bnx2x_8727_specific_func
};
static const struct bnx2x_phy phy_8481 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,
@@ -11966,13 +11952,13 @@ static const struct bnx2x_phy phy_8481 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_8481_config_init,
- .read_status = (read_status_t)bnx2x_848xx_read_status,
- .link_reset = (link_reset_t)bnx2x_8481_link_reset,
+ .config_init = bnx2x_8481_config_init,
+ .read_status = bnx2x_848xx_read_status,
+ .link_reset = bnx2x_8481_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_8481_hw_reset,
- .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
+ .format_fw_ver = bnx2x_848xx_format_ver,
+ .hw_reset = bnx2x_8481_hw_reset,
+ .set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL
};
@@ -12003,14 +11989,14 @@ static const struct bnx2x_phy phy_84823 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_848x3_config_init,
- .read_status = (read_status_t)bnx2x_848xx_read_status,
- .link_reset = (link_reset_t)bnx2x_848x3_link_reset,
+ .config_init = bnx2x_848x3_config_init,
+ .read_status = bnx2x_848xx_read_status,
+ .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
+ .format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)NULL,
- .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
+ .set_link_led = bnx2x_848xx_set_link_led,
+ .phy_specific_func = bnx2x_848xx_specific_func
};
static const struct bnx2x_phy phy_84833 = {
@@ -12038,14 +12024,14 @@ static const struct bnx2x_phy phy_84833 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_848x3_config_init,
- .read_status = (read_status_t)bnx2x_848xx_read_status,
- .link_reset = (link_reset_t)bnx2x_848x3_link_reset,
+ .config_init = bnx2x_848x3_config_init,
+ .read_status = bnx2x_848xx_read_status,
+ .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
- .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
+ .format_fw_ver = bnx2x_848xx_format_ver,
+ .hw_reset = bnx2x_84833_hw_reset_phy,
+ .set_link_led = bnx2x_848xx_set_link_led,
+ .phy_specific_func = bnx2x_848xx_specific_func
};
static const struct bnx2x_phy phy_84834 = {
@@ -12072,14 +12058,14 @@ static const struct bnx2x_phy phy_84834 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_848x3_config_init,
- .read_status = (read_status_t)bnx2x_848xx_read_status,
- .link_reset = (link_reset_t)bnx2x_848x3_link_reset,
+ .config_init = bnx2x_848x3_config_init,
+ .read_status = bnx2x_848xx_read_status,
+ .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
- .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
+ .format_fw_ver = bnx2x_848xx_format_ver,
+ .hw_reset = bnx2x_84833_hw_reset_phy,
+ .set_link_led = bnx2x_848xx_set_link_led,
+ .phy_specific_func = bnx2x_848xx_specific_func
};
static const struct bnx2x_phy phy_84858 = {
@@ -12106,14 +12092,14 @@ static const struct bnx2x_phy phy_84858 = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
- .config_init = (config_init_t)bnx2x_848x3_config_init,
- .read_status = (read_status_t)bnx2x_848xx_read_status,
- .link_reset = (link_reset_t)bnx2x_848x3_link_reset,
+ .config_init = bnx2x_848x3_config_init,
+ .read_status = bnx2x_848xx_read_status,
+ .link_reset = bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
- .format_fw_ver = (format_fw_ver_t)bnx2x_8485x_format_ver,
- .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
- .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
+ .format_fw_ver = bnx2x_8485x_format_ver,
+ .hw_reset = bnx2x_84833_hw_reset_phy,
+ .set_link_led = bnx2x_848xx_set_link_led,
+ .phy_specific_func = bnx2x_848xx_specific_func
};
static const struct bnx2x_phy phy_54618se = {
@@ -12140,14 +12126,14 @@ static const struct bnx2x_phy phy_54618se = {
.speed_cap_mask = 0,
/* req_duplex = */0,
/* rsrv = */0,
- .config_init = (config_init_t)bnx2x_54618se_config_init,
- .read_status = (read_status_t)bnx2x_54618se_read_status,
- .link_reset = (link_reset_t)bnx2x_54618se_link_reset,
- .config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback,
+ .config_init = bnx2x_54618se_config_init,
+ .read_status = bnx2x_54618se_read_status,
+ .link_reset = bnx2x_54618se_link_reset,
+ .config_loopback = bnx2x_54618se_config_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
- .set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led,
- .phy_specific_func = (phy_specific_func_t)bnx2x_54618se_specific_func
+ .set_link_led = bnx2x_5461x_set_link_led,
+ .phy_specific_func = bnx2x_54618se_specific_func
};
/*****************************************************************/
/* */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index b7d251108c19..a625bae0fc85 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -126,7 +126,7 @@ struct link_vars;
struct link_params;
struct bnx2x_phy;
-typedef u8 (*config_init_t)(struct bnx2x_phy *phy, struct link_params *params,
+typedef void (*config_init_t)(struct bnx2x_phy *phy, struct link_params *params,
struct link_vars *vars);
typedef u8 (*read_status_t)(struct bnx2x_phy *phy, struct link_params *params,
struct link_vars *vars);
@@ -134,7 +134,7 @@ typedef void (*link_reset_t)(struct bnx2x_phy *phy,
struct link_params *params);
typedef void (*config_loopback_t)(struct bnx2x_phy *phy,
struct link_params *params);
-typedef u8 (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len);
+typedef int (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len);
typedef void (*hw_reset_t)(struct bnx2x_phy *phy, struct link_params *params);
typedef void (*set_link_led_t)(struct bnx2x_phy *phy,
struct link_params *params, u8 mode);
diff --git a/drivers/net/ethernet/brocade/bna/bfa_cs.h b/drivers/net/ethernet/brocade/bna/bfa_cs.h
index 1d11d666d408..8f7a3cb9c4de 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_cs.h
+++ b/drivers/net/ethernet/brocade/bna/bfa_cs.h
@@ -34,10 +34,19 @@ struct bfa_sm_table {
int state; /*!< state machine encoding */
char *name; /*!< state name for display */
};
-#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
+#define BFA_SM(_sm) (_sm)
+
+#define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (_state))
+#define bfa_sm_cmp_state(_sm, _state) ((_sm)->sm == (_state))
/* State machine with entry actions. */
-typedef void (*bfa_fsm_t)(void *fsm, int event);
+struct bfa_ioc;
+enum ioc_event;
+struct bfa_iocpf;
+enum iocpf_event;
+
+typedef void (*bfa_fsm_ioc_t)(struct bfa_ioc *fsm, enum ioc_event event);
+typedef void (*bfa_fsm_iocpf_t)(struct bfa_iocpf *fsm, enum iocpf_event event);
/* oc - object class eg. bfa_ioc
* st - state, eg. reset
@@ -49,16 +58,37 @@ typedef void (*bfa_fsm_t)(void *fsm, int event);
static void oc ## _sm_ ## st ## _entry(otype * fsm)
#define bfa_fsm_set_state(_fsm, _state) do { \
- (_fsm)->fsm = (bfa_fsm_t)(_state); \
+ (_fsm)->fsm = (_state); \
_state ## _entry(_fsm); \
} while (0)
#define bfa_fsm_send_event(_fsm, _event) ((_fsm)->fsm((_fsm), (_event)))
-#define bfa_fsm_cmp_state(_fsm, _state) \
- ((_fsm)->fsm == (bfa_fsm_t)(_state))
+#define bfa_fsm_cmp_state(_fsm, _state) ((_fsm)->fsm == (_state))
+
+/* For converting from state machine function to state encoding. */
+struct iocpf_sm_table {
+ bfa_fsm_iocpf_t sm; /*!< state machine function */
+ int state; /*!< state machine encoding */
+ char *name; /*!< state name for display */
+};
+struct ioc_sm_table {
+ bfa_fsm_ioc_t sm; /*!< state machine function */
+ int state; /*!< state machine encoding */
+ char *name; /*!< state name for display */
+};
+
+static inline int
+iocpf_sm_to_state(const struct iocpf_sm_table *smt, bfa_fsm_iocpf_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
static inline int
-bfa_sm_to_state(const struct bfa_sm_table *smt, bfa_sm_t sm)
+ioc_sm_to_state(const struct ioc_sm_table *smt, bfa_fsm_ioc_t sm)
{
int i = 0;
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
index a36e38676640..725b0426fae6 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
@@ -122,7 +122,7 @@ bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc, enum ioc_event);
bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc, enum ioc_event);
bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc, enum ioc_event);
-static struct bfa_sm_table ioc_sm_table[] = {
+static struct ioc_sm_table ioc_sm_table[] = {
{BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT},
{BFA_SM(bfa_ioc_sm_reset), BFA_IOC_RESET},
{BFA_SM(bfa_ioc_sm_enabling), BFA_IOC_ENABLING},
@@ -191,7 +191,7 @@ bfa_fsm_state_decl(bfa_iocpf, disabling_sync, struct bfa_iocpf,
enum iocpf_event);
bfa_fsm_state_decl(bfa_iocpf, disabled, struct bfa_iocpf, enum iocpf_event);
-static struct bfa_sm_table iocpf_sm_table[] = {
+static struct iocpf_sm_table iocpf_sm_table[] = {
{BFA_SM(bfa_iocpf_sm_reset), BFA_IOCPF_RESET},
{BFA_SM(bfa_iocpf_sm_fwcheck), BFA_IOCPF_FWMISMATCH},
{BFA_SM(bfa_iocpf_sm_mismatch), BFA_IOCPF_FWMISMATCH},
@@ -2866,12 +2866,12 @@ static enum bfa_ioc_state
bfa_ioc_get_state(struct bfa_ioc *ioc)
{
enum bfa_iocpf_state iocpf_st;
- enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
+ enum bfa_ioc_state ioc_st = ioc_sm_to_state(ioc_sm_table, ioc->fsm);
if (ioc_st == BFA_IOC_ENABLING ||
ioc_st == BFA_IOC_FAIL || ioc_st == BFA_IOC_INITFAIL) {
- iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
+ iocpf_st = iocpf_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
switch (iocpf_st) {
case BFA_IOCPF_SEMWAIT:
@@ -2989,7 +2989,7 @@ bfa_nw_iocpf_timeout(struct bfa_ioc *ioc)
{
enum bfa_iocpf_state iocpf_st;
- iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
+ iocpf_st = iocpf_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
if (iocpf_st == BFA_IOCPF_HWINIT)
bfa_ioc_poll_fwinit(ioc);
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h
index 2c0b4c076355..97873eb3c942 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h
@@ -156,7 +156,7 @@ struct bfa_ioc_notify {
} while (0)
struct bfa_iocpf {
- bfa_fsm_t fsm;
+ bfa_fsm_iocpf_t fsm;
struct bfa_ioc *ioc;
bool fw_mismatch_notified;
bool auto_recover;
@@ -164,7 +164,7 @@ struct bfa_iocpf {
};
struct bfa_ioc {
- bfa_fsm_t fsm;
+ bfa_fsm_ioc_t fsm;
struct bfa *bfa;
struct bfa_pcidev pcidev;
struct timer_list ioc_timer;
diff --git a/drivers/net/ethernet/brocade/bna/bfa_msgq.h b/drivers/net/ethernet/brocade/bna/bfa_msgq.h
index 66bc8b5acd57..bf64466764ce 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_msgq.h
+++ b/drivers/net/ethernet/brocade/bna/bfa_msgq.h
@@ -63,8 +63,10 @@ enum bfa_msgq_cmdq_flags {
BFA_MSGQ_CMDQ_F_DB_UPDATE = 1,
};
+enum cmdq_event;
+
struct bfa_msgq_cmdq {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bfa_msgq_cmdq *, enum cmdq_event);
enum bfa_msgq_cmdq_flags flags;
u16 producer_index;
@@ -89,8 +91,10 @@ enum bfa_msgq_rspq_flags {
typedef void (*bfa_msgq_mcfunc_t)(void *cbarg, struct bfi_msgq_mhdr *mhdr);
+enum rspq_event;
+
struct bfa_msgq_rspq {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bfa_msgq_rspq *, enum rspq_event);
enum bfa_msgq_rspq_flags flags;
u16 producer_index;
diff --git a/drivers/net/ethernet/brocade/bna/bna_enet.c b/drivers/net/ethernet/brocade/bna/bna_enet.c
index bba81735ce87..0791dab5bd20 100644
--- a/drivers/net/ethernet/brocade/bna/bna_enet.c
+++ b/drivers/net/ethernet/brocade/bna/bna_enet.c
@@ -1265,7 +1265,7 @@ bna_enet_mtu_get(struct bna_enet *enet)
void
bna_enet_enable(struct bna_enet *enet)
{
- if (enet->fsm != (bfa_sm_t)bna_enet_sm_stopped)
+ if (enet->fsm != bna_enet_sm_stopped)
return;
enet->flags |= BNA_ENET_F_ENABLED;
@@ -1759,12 +1759,12 @@ bna_ioceth_uninit(struct bna_ioceth *ioceth)
void
bna_ioceth_enable(struct bna_ioceth *ioceth)
{
- if (ioceth->fsm == (bfa_fsm_t)bna_ioceth_sm_ready) {
+ if (ioceth->fsm == bna_ioceth_sm_ready) {
bnad_cb_ioceth_ready(ioceth->bna->bnad);
return;
}
- if (ioceth->fsm == (bfa_fsm_t)bna_ioceth_sm_stopped)
+ if (ioceth->fsm == bna_ioceth_sm_stopped)
bfa_fsm_send_event(ioceth, IOCETH_E_ENABLE);
}
diff --git a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
index 95bc470ae441..c12be9f9730c 100644
--- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
+++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c
@@ -1964,7 +1964,7 @@ static void
bna_rx_stop(struct bna_rx *rx)
{
rx->rx_flags &= ~BNA_RX_F_ENET_STARTED;
- if (rx->fsm == (bfa_fsm_t) bna_rx_sm_stopped)
+ if (rx->fsm == bna_rx_sm_stopped)
bna_rx_mod_cb_rx_stopped(&rx->bna->rx_mod, rx);
else {
rx->stop_cbfn = bna_rx_mod_cb_rx_stopped;
@@ -2543,7 +2543,7 @@ bna_rx_destroy(struct bna_rx *rx)
void
bna_rx_enable(struct bna_rx *rx)
{
- if (rx->fsm != (bfa_sm_t)bna_rx_sm_stopped)
+ if (rx->fsm != bna_rx_sm_stopped)
return;
rx->rx_flags |= BNA_RX_F_ENABLED;
@@ -3531,7 +3531,7 @@ bna_tx_destroy(struct bna_tx *tx)
void
bna_tx_enable(struct bna_tx *tx)
{
- if (tx->fsm != (bfa_sm_t)bna_tx_sm_stopped)
+ if (tx->fsm != bna_tx_sm_stopped)
return;
tx->flags |= BNA_TX_F_ENABLED;
diff --git a/drivers/net/ethernet/brocade/bna/bna_types.h b/drivers/net/ethernet/brocade/bna/bna_types.h
index c438d032e8bf..4653f43e8771 100644
--- a/drivers/net/ethernet/brocade/bna/bna_types.h
+++ b/drivers/net/ethernet/brocade/bna/bna_types.h
@@ -320,8 +320,10 @@ struct bna_attr {
/* IOCEth */
+enum bna_ioceth_event;
+
struct bna_ioceth {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_ioceth *, enum bna_ioceth_event);
struct bfa_ioc ioc;
struct bna_attr attr;
@@ -342,8 +344,10 @@ struct bna_pause_config {
enum bna_status rx_pause;
};
+enum bna_enet_event;
+
struct bna_enet {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_enet *, enum bna_enet_event);
enum bna_enet_flags flags;
enum bna_enet_type type;
@@ -368,8 +372,10 @@ struct bna_enet {
/* Ethport */
+enum bna_ethport_event;
+
struct bna_ethport {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_ethport *, enum bna_ethport_event);
enum bna_ethport_flags flags;
enum bna_link_status link_status;
@@ -462,13 +468,15 @@ struct bna_txq {
};
/* Tx object */
+enum bna_tx_event;
+
struct bna_tx {
/* This should be the first one */
struct list_head qe;
int rid;
int hw_id;
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_tx *, enum bna_tx_event);
enum bna_tx_flags flags;
enum bna_tx_type type;
@@ -706,8 +714,10 @@ struct bna_rxp {
};
/* RxF structure (hardware Rx Function) */
+enum bna_rxf_event;
+
struct bna_rxf {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_rxf *, enum bna_rxf_event);
struct bfa_msgq_cmd_entry msgq_cmd;
union {
@@ -777,13 +787,15 @@ struct bna_rxf {
};
/* Rx object */
+enum bna_rx_event;
+
struct bna_rx {
/* This should be the first one */
struct list_head qe;
int rid;
int hw_id;
- bfa_fsm_t fsm;
+ void (*fsm)(struct bna_rx *, enum bna_rx_event);
enum bna_rx_type type;
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index ea5f32ea308a..fb703f19acdc 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -1100,8 +1100,9 @@ bnad_cb_tx_resume(struct bnad *bnad, struct bna_tx *tx)
* Free all TxQs buffers and then notify TX_E_CLEANUP_DONE to Tx fsm.
*/
static void
-bnad_tx_cleanup(struct delayed_work *work)
+bnad_tx_cleanup(struct work_struct *_work)
{
+ struct delayed_work *work = (struct delayed_work *)_work;
struct bnad_tx_info *tx_info =
container_of(work, struct bnad_tx_info, tx_cleanup_work);
struct bnad *bnad = NULL;
@@ -1179,7 +1180,7 @@ bnad_cb_rx_stall(struct bnad *bnad, struct bna_rx *rx)
* Free all RxQs buffers and then notify RX_E_CLEANUP_DONE to Rx fsm.
*/
static void
-bnad_rx_cleanup(void *work)
+bnad_rx_cleanup(struct work_struct *work)
{
struct bnad_rx_info *rx_info =
container_of(work, struct bnad_rx_info, rx_cleanup_work);
@@ -2001,8 +2002,7 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_id)
}
tx_info->tx = tx;
- INIT_DELAYED_WORK(&tx_info->tx_cleanup_work,
- (work_func_t)bnad_tx_cleanup);
+ INIT_DELAYED_WORK(&tx_info->tx_cleanup_work, bnad_tx_cleanup);
/* Register ISR for the Tx object */
if (intr_info->intr_type == BNA_INTR_T_MSIX) {
@@ -2258,8 +2258,7 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_id)
rx_info->rx = rx;
spin_unlock_irqrestore(&bnad->bna_lock, flags);
- INIT_WORK(&rx_info->rx_cleanup_work,
- (work_func_t)(bnad_rx_cleanup));
+ INIT_WORK(&rx_info->rx_cleanup_work, bnad_rx_cleanup);
/*
* Init NAPI, so that state is set to NAPI_STATE_SCHED,
diff --git a/drivers/ras/ras.c b/drivers/ras/ras.c
index 3f38907320dc..95540ea8dd9d 100644
--- a/drivers/ras/ras.c
+++ b/drivers/ras/ras.c
@@ -14,7 +14,7 @@
#define TRACE_INCLUDE_PATH ../../include/ras
#include <ras/ras_event.h>
-void log_non_standard_event(const uuid_le *sec_type, const uuid_le *fru_id,
+void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id,
const char *fru_text, const u8 sev, const u8 *err,
const u32 len)
{
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 6e356325d8d9..53f41636a2bb 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -812,6 +812,11 @@ static int aac_probe_container_callback1(struct scsi_cmnd * scsicmd)
return 0;
}
+static void aac_probe_container_scsi_done(struct scsi_cmnd * scsicmd)
+{
+ scsicmd->device = NULL;
+}
+
int aac_probe_container(struct aac_dev *dev, int cid)
{
struct scsi_cmnd *scsicmd = kmalloc(sizeof(*scsicmd), GFP_KERNEL);
@@ -824,7 +829,7 @@ int aac_probe_container(struct aac_dev *dev, int cid)
return -ENOMEM;
}
scsicmd->list.next = NULL;
- scsicmd->scsi_done = (void (*)(struct scsi_cmnd*))aac_probe_container_callback1;
+ scsicmd->scsi_done = aac_probe_container_scsi_done;
scsicmd->device = scsidev;
scsidev->sdev_state = 0;
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index 0e119d838e1b..1bf8a4946d1e 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -225,8 +225,10 @@ struct bfa_faa_args_s {
bfa_boolean_t busy;
};
+enum iocfc_event;
+
struct bfa_iocfc_s {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bfa_iocfc_s *, enum iocfc_event);
struct bfa_s *bfa;
struct bfa_iocfc_cfg_s cfg;
u32 req_cq_pi[BFI_IOC_MAX_CQS];
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 10a63be92544..35d87b2c6027 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -1915,15 +1915,13 @@ bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q)
struct list_head *qe;
struct list_head *qen;
struct bfa_cb_qe_s *hcb_qe;
- bfa_cb_cbfn_status_t cbfn;
list_for_each_safe(qe, qen, comp_q) {
hcb_qe = (struct bfa_cb_qe_s *) qe;
if (hcb_qe->pre_rmv) {
/* qe is invalid after return, dequeue before cbfn() */
list_del(qe);
- cbfn = (bfa_cb_cbfn_status_t)(hcb_qe->cbfn);
- cbfn(hcb_qe->cbarg, hcb_qe->fw_status);
+ hcb_qe->cbfn(hcb_qe->cbarg, hcb_qe->fw_status);
} else
hcb_qe->cbfn(hcb_qe->cbarg, BFA_TRUE);
}
diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h
index 9685efc59b16..94a62e48bcd4 100644
--- a/drivers/scsi/bfa/bfa_cs.h
+++ b/drivers/scsi/bfa/bfa_cs.h
@@ -184,8 +184,6 @@ bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe)
* @ BFA state machine interfaces
*/
-typedef void (*bfa_sm_t)(void *sm, int event);
-
/*
* oc - object class eg. bfa_ioc
* st - state, eg. reset
@@ -195,20 +193,75 @@ typedef void (*bfa_sm_t)(void *sm, int event);
#define bfa_sm_state_decl(oc, st, otype, etype) \
static void oc ## _sm_ ## st(otype * fsm, etype event)
-#define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (bfa_sm_t)(_state))
+#define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (_state))
#define bfa_sm_send_event(_sm, _event) ((_sm)->sm((_sm), (_event)))
#define bfa_sm_get_state(_sm) ((_sm)->sm)
-#define bfa_sm_cmp_state(_sm, _state) ((_sm)->sm == (bfa_sm_t)(_state))
+#define bfa_sm_cmp_state(_sm, _state) ((_sm)->sm == (_state))
/*
* For converting from state machine function to state encoding.
*/
-struct bfa_sm_table_s {
- bfa_sm_t sm; /* state machine function */
+struct bfa_iocpf_s;
+enum iocpf_event;
+typedef void (*bfa_fsm_iocpf_t)(struct bfa_iocpf_s *, enum iocpf_event);
+
+struct iocpf_sm_table_s {
+ bfa_fsm_iocpf_t sm; /* state machine function */
+ int state; /* state machine encoding */
+ char *name; /* state name for display */
+};
+
+struct bfa_ioc_s;
+enum ioc_event;
+typedef void (*bfa_fsm_ioc_t)(struct bfa_ioc_s *, enum ioc_event);
+
+struct ioc_sm_table_s {
+ bfa_fsm_ioc_t sm; /* state machine function */
int state; /* state machine encoding */
char *name; /* state name for display */
};
-#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
+
+struct bfa_fcs_rport_s;
+enum rport_event;
+typedef void(*bfa_fcs_rport_t)(struct bfa_fcs_rport_s *, enum rport_event);
+
+struct rport_sm_table_s {
+ bfa_fcs_rport_t sm; /* state machine function */
+ int state; /* state machine encoding */
+ char *name; /* state name for display */
+};
+
+struct bfa_fcs_vport_s;
+enum bfa_fcs_vport_event;
+typedef void(*bfa_fcs_vport_t)(struct bfa_fcs_vport_s *, enum bfa_fcs_vport_event);
+
+struct vport_sm_table_s {
+ bfa_fcs_vport_t sm; /* state machine function */
+ int state; /* state machine encoding */
+ char *name; /* state name for display */
+};
+
+struct bfa_fcs_itnim_s;
+enum bfa_fcs_itnim_event;
+typedef void(*bfa_fcs_itnim_t)(struct bfa_fcs_itnim_s *, enum bfa_fcs_itnim_event);
+
+struct itnim_sm_table_s {
+ bfa_fcs_itnim_t sm; /* state machine function */
+ int state; /* state machine encoding */
+ char *name; /* state name for display */
+};
+
+struct bfa_fcport_s;
+enum bfa_fcport_sm_event;
+typedef void(*bfa_fcport_t)(struct bfa_fcport_s *, enum bfa_fcport_sm_event);
+
+struct fcport_sm_table_s {
+ bfa_fcport_t sm; /* state machine function */
+ int state; /* state machine encoding */
+ char *name; /* state name for display */
+};
+
+#define BFA_SM(_sm) (_sm)
/*
* State machine with entry actions.
@@ -226,17 +279,66 @@ typedef void (*bfa_fsm_t)(void *fsm, int event);
static void oc ## _sm_ ## st ## _entry(otype * fsm)
#define bfa_fsm_set_state(_fsm, _state) do { \
- (_fsm)->fsm = (bfa_fsm_t)(_state); \
+ (_fsm)->fsm = (_state); \
_state ## _entry(_fsm); \
} while (0)
#define bfa_fsm_send_event(_fsm, _event) ((_fsm)->fsm((_fsm), (_event)))
#define bfa_fsm_get_state(_fsm) ((_fsm)->fsm)
-#define bfa_fsm_cmp_state(_fsm, _state) \
- ((_fsm)->fsm == (bfa_fsm_t)(_state))
+#define bfa_fsm_cmp_state(_fsm, _state) ((_fsm)->fsm == (_state))
+
+static inline int
+iocpf_sm_to_state(struct iocpf_sm_table_s *smt, bfa_fsm_iocpf_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
+
+static inline int
+ioc_sm_to_state(struct ioc_sm_table_s *smt, bfa_fsm_ioc_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
+
+static inline int
+rport_sm_to_state(struct rport_sm_table_s *smt, bfa_fcs_rport_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
+
+static inline int
+vport_sm_to_state(struct vport_sm_table_s *smt, bfa_fcs_vport_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
+
+static inline int
+itnim_sm_to_state(struct itnim_sm_table_s *smt, bfa_fcs_itnim_t sm)
+{
+ int i = 0;
+
+ while (smt[i].sm && smt[i].sm != sm)
+ i++;
+ return smt[i].state;
+}
static inline int
-bfa_sm_to_state(struct bfa_sm_table_s *smt, bfa_sm_t sm)
+fcport_sm_to_state(struct fcport_sm_table_s *smt, bfa_fcport_t sm)
{
int i = 0;
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index ec8f863540ae..84f235462c16 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -165,9 +165,11 @@ struct bfa_fcp_mod_s {
/*
* BFA IO (initiator mode)
*/
+enum bfa_ioim_event;
+
struct bfa_ioim_s {
struct list_head qe; /* queue elememt */
- bfa_sm_t sm; /* BFA ioim state machine */
+ void (*sm)(struct bfa_ioim_s *, enum bfa_ioim_event);/* BFA ioim state machine */
struct bfa_s *bfa; /* BFA module */
struct bfa_fcpim_s *fcpim; /* parent fcpim module */
struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
@@ -197,9 +199,11 @@ struct bfa_ioim_sp_s {
/*
* BFA Task management command (initiator mode)
*/
+enum bfa_tskim_event;
+
struct bfa_tskim_s {
struct list_head qe;
- bfa_sm_t sm;
+ void (*sm)(struct bfa_tskim_s *, enum bfa_tskim_event);
struct bfa_s *bfa; /* BFA module */
struct bfa_fcpim_s *fcpim; /* parent fcpim module */
struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
@@ -219,9 +223,11 @@ struct bfa_tskim_s {
/*
* BFA i-t-n (initiator mode)
*/
+enum bfa_itnim_event;
+
struct bfa_itnim_s {
struct list_head qe; /* queue element */
- bfa_sm_t sm; /* i-t-n im BFA state machine */
+ void (*sm)(struct bfa_itnim_s *, enum bfa_itnim_event);/* i-t-n im BFA state machine */
struct bfa_s *bfa; /* bfa instance */
struct bfa_rport_s *rport; /* bfa rport */
void *ditn; /* driver i-t-n structure */
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index e60f72b766ea..3606b0084932 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -67,8 +67,10 @@ struct bfa_fcs_s;
#define BFA_FCS_PID_IS_WKA(pid) ((bfa_ntoh3b(pid) > 0xFFF000) ? 1 : 0)
#define BFA_FCS_MAX_RPORT_LOGINS 1024
+enum vport_ns_event;
+
struct bfa_fcs_lport_ns_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_lport_ns_s *, enum vport_ns_event);/* state machine */
struct bfa_timer_s timer;
struct bfa_fcs_lport_s *port; /* parent port */
struct bfa_fcxp_s *fcxp;
@@ -77,18 +79,20 @@ struct bfa_fcs_lport_ns_s {
u8 num_rsnn_nn_retries;
};
+enum port_scn_event;
struct bfa_fcs_lport_scn_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_lport_scn_s *, enum port_scn_event);/* state machine */
struct bfa_timer_s timer;
struct bfa_fcs_lport_s *port; /* parent port */
struct bfa_fcxp_s *fcxp;
struct bfa_fcxp_wqe_s fcxp_wqe;
};
+enum port_fdmi_event;
struct bfa_fcs_lport_fdmi_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_lport_fdmi_s *, enum port_fdmi_event);/* state machine */
struct bfa_timer_s timer;
struct bfa_fcs_lport_ms_s *ms; /* parent ms */
struct bfa_fcxp_s *fcxp;
@@ -97,9 +101,10 @@ struct bfa_fcs_lport_fdmi_s {
u8 rsvd[3];
};
+enum port_ms_event;
struct bfa_fcs_lport_ms_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_lport_ms_s *, enum port_ms_event);/* state machine */
struct bfa_timer_s timer;
struct bfa_fcs_lport_s *port; /* parent port */
struct bfa_fcxp_s *fcxp;
@@ -139,10 +144,11 @@ union bfa_fcs_lport_topo_u {
struct bfa_fcs_lport_n2n_s pn2n;
};
+enum bfa_fcs_lport_event;
struct bfa_fcs_lport_s {
struct list_head qe; /* used by port/vport */
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_lport_s *, enum bfa_fcs_lport_event); /* state machine */
struct bfa_fcs_fabric_s *fabric; /* parent fabric */
struct bfa_lport_cfg_s port_cfg; /* port configuration */
struct bfa_timer_s link_timer; /* timer for link offline */
@@ -179,10 +185,11 @@ enum bfa_fcs_fabric_type {
BFA_FCS_FABRIC_LOOP = 3,
};
+enum bfa_fcs_fabric_event;
struct bfa_fcs_fabric_s {
struct list_head qe; /* queue element */
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_fabric_s *, enum bfa_fcs_fabric_event); /* state machine */
struct bfa_fcs_s *fcs; /* FCS instance */
struct bfa_fcs_lport_s bport; /* base logical port */
enum bfa_fcs_fabric_type fab_type; /* fabric type */
@@ -355,9 +362,11 @@ void bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
struct fchs_s *rx_frame, u32 len);
void bfa_fcs_lport_lip_scn_online(bfa_fcs_lport_t *port);
+enum bfa_fcs_vport_event;
+
struct bfa_fcs_vport_s {
struct list_head qe; /* queue elem */
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_vport_s *, enum bfa_fcs_vport_event);/* state machine */
bfa_fcs_lport_t lport; /* logical port */
struct bfa_timer_s timer;
struct bfad_vport_s *vport_drv; /* Driver private */
@@ -409,8 +418,10 @@ struct bfa_fcs_tin_s;
struct bfa_fcs_iprp_s;
/* Rport Features (RPF) */
+enum rpf_event;
+
struct bfa_fcs_rpf_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_rpf_s *, enum rpf_event); /* state machine */
struct bfa_fcs_rport_s *rport; /* parent rport */
struct bfa_timer_s timer; /* general purpose timer */
struct bfa_fcxp_s *fcxp; /* FCXP needed for discarding */
@@ -425,6 +436,8 @@ struct bfa_fcs_rpf_s {
*/
};
+enum rport_event;
+
struct bfa_fcs_rport_s {
struct list_head qe; /* used by port/vport */
struct bfa_fcs_lport_s *port; /* parent FCS port */
@@ -441,7 +454,7 @@ struct bfa_fcs_rport_s {
wwn_t pwwn; /* port wwn of rport */
wwn_t nwwn; /* node wwn of rport */
struct bfa_rport_symname_s psym_name; /* port symbolic name */
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_rport_s *, enum rport_event); /* state machine */
struct bfa_timer_s timer; /* general purpose timer */
struct bfa_fcs_itnim_s *itnim; /* ITN initiator mode role */
struct bfa_fcs_tin_s *tin; /* ITN initiator mode role */
@@ -502,9 +515,10 @@ void bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
* forward declarations
*/
struct bfad_itnim_s;
+enum bfa_fcs_itnim_event;
struct bfa_fcs_itnim_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_fcs_itnim_s *, enum bfa_fcs_itnim_event);/* state machine */
struct bfa_fcs_rport_s *rport; /* parent remote rport */
struct bfad_itnim_s *itnim_drv; /* driver peer instance */
struct bfa_fcs_s *fcs; /* fcs instance */
diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c
index 2e3b19e7e079..7a9b7299dda0 100644
--- a/drivers/scsi/bfa/bfa_fcs_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c
@@ -60,7 +60,7 @@ static void bfa_fcs_itnim_sm_hcb_offline(struct bfa_fcs_itnim_s *itnim,
static void bfa_fcs_itnim_sm_initiator(struct bfa_fcs_itnim_s *itnim,
enum bfa_fcs_itnim_event event);
-static struct bfa_sm_table_s itnim_sm_table[] = {
+static struct itnim_sm_table_s itnim_sm_table[] = {
{BFA_SM(bfa_fcs_itnim_sm_offline), BFA_ITNIM_OFFLINE},
{BFA_SM(bfa_fcs_itnim_sm_prli_send), BFA_ITNIM_PRLI_SEND},
{BFA_SM(bfa_fcs_itnim_sm_prli), BFA_ITNIM_PRLI_SENT},
@@ -673,7 +673,7 @@ bfa_status_t
bfa_fcs_itnim_get_online_state(struct bfa_fcs_itnim_s *itnim)
{
bfa_trc(itnim->fcs, itnim->rport->pid);
- switch (bfa_sm_to_state(itnim_sm_table, itnim->sm)) {
+ switch (itnim_sm_to_state(itnim_sm_table, itnim->sm)) {
case BFA_ITNIM_ONLINE:
case BFA_ITNIM_INITIATIOR:
return BFA_STATUS_OK;
@@ -773,7 +773,7 @@ bfa_fcs_itnim_attr_get(struct bfa_fcs_lport_s *port, wwn_t rpwwn,
if (itnim == NULL)
return BFA_STATUS_NO_FCPIM_NEXUS;
- attr->state = bfa_sm_to_state(itnim_sm_table, itnim->sm);
+ attr->state = itnim_sm_to_state(itnim_sm_table, itnim->sm);
attr->retry = itnim->seq_rec;
attr->rec_support = itnim->rec_support;
attr->conf_comp = itnim->conf_comp;
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index b4f2c1d8742e..e28cce5fb30a 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -6037,7 +6037,7 @@ static void bfa_fcs_vport_sm_stopping(struct bfa_fcs_vport_s *vport,
static void bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s *vport,
enum bfa_fcs_vport_event event);
-static struct bfa_sm_table_s vport_sm_table[] = {
+static struct vport_sm_table_s vport_sm_table[] = {
{BFA_SM(bfa_fcs_vport_sm_uninit), BFA_FCS_VPORT_UNINIT},
{BFA_SM(bfa_fcs_vport_sm_created), BFA_FCS_VPORT_CREATED},
{BFA_SM(bfa_fcs_vport_sm_offline), BFA_FCS_VPORT_OFFLINE},
@@ -6868,7 +6868,7 @@ bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
memset(attr, 0, sizeof(struct bfa_vport_attr_s));
bfa_fcs_lport_get_attr(&vport->lport, &attr->port_attr);
- attr->vport_state = bfa_sm_to_state(vport_sm_table, vport->sm);
+ attr->vport_state = vport_sm_to_state(vport_sm_table, vport->sm);
}
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index de50349a39ce..6d676bea3b7a 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -144,7 +144,7 @@ static void bfa_fcs_rport_sm_fc4_off_delete(struct bfa_fcs_rport_s *rport,
static void bfa_fcs_rport_sm_delete_pending(struct bfa_fcs_rport_s *rport,
enum rport_event event);
-static struct bfa_sm_table_s rport_sm_table[] = {
+static struct rport_sm_table_s rport_sm_table[] = {
{BFA_SM(bfa_fcs_rport_sm_uninit), BFA_RPORT_UNINIT},
{BFA_SM(bfa_fcs_rport_sm_plogi_sending), BFA_RPORT_PLOGI},
{BFA_SM(bfa_fcs_rport_sm_plogiacc_sending), BFA_RPORT_ONLINE},
@@ -2980,7 +2980,7 @@ bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
int
bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport)
{
- return bfa_sm_to_state(rport_sm_table, rport->sm);
+ return rport_sm_to_state(rport_sm_table, rport->sm);
}
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 16d3aeb0e572..43ac9ffb0932 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -148,7 +148,7 @@ bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc_s, enum ioc_event);
bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc_s, enum ioc_event);
bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc_s, enum ioc_event);
-static struct bfa_sm_table_s ioc_sm_table[] = {
+static struct ioc_sm_table_s ioc_sm_table[] = {
{BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT},
{BFA_SM(bfa_ioc_sm_reset), BFA_IOC_RESET},
{BFA_SM(bfa_ioc_sm_enabling), BFA_IOC_ENABLING},
@@ -236,7 +236,7 @@ bfa_fsm_state_decl(bfa_iocpf, disabling_sync, struct bfa_iocpf_s,
enum iocpf_event);
bfa_fsm_state_decl(bfa_iocpf, disabled, struct bfa_iocpf_s, enum iocpf_event);
-static struct bfa_sm_table_s iocpf_sm_table[] = {
+static struct iocpf_sm_table_s iocpf_sm_table[] = {
{BFA_SM(bfa_iocpf_sm_reset), BFA_IOCPF_RESET},
{BFA_SM(bfa_iocpf_sm_fwcheck), BFA_IOCPF_FWMISMATCH},
{BFA_SM(bfa_iocpf_sm_mismatch), BFA_IOCPF_FWMISMATCH},
@@ -2832,12 +2832,12 @@ enum bfa_ioc_state
bfa_ioc_get_state(struct bfa_ioc_s *ioc)
{
enum bfa_iocpf_state iocpf_st;
- enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
+ enum bfa_ioc_state ioc_st = ioc_sm_to_state(ioc_sm_table, ioc->fsm);
if (ioc_st == BFA_IOC_ENABLING ||
ioc_st == BFA_IOC_FAIL || ioc_st == BFA_IOC_INITFAIL) {
- iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
+ iocpf_st = iocpf_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
switch (iocpf_st) {
case BFA_IOCPF_SEMWAIT:
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 0f9fab770339..51a3f75e9273 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -290,16 +290,20 @@ struct bfa_ioc_notify_s {
(__notify)->cbarg = (__cbarg); \
} while (0)
+enum iocpf_event;
+
struct bfa_iocpf_s {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bfa_iocpf_s *, enum iocpf_event);
struct bfa_ioc_s *ioc;
bfa_boolean_t fw_mismatch_notified;
bfa_boolean_t auto_recover;
u32 poll_time;
};
+enum ioc_event;
+
struct bfa_ioc_s {
- bfa_fsm_t fsm;
+ void (*fsm)(struct bfa_ioc_s *, enum ioc_event);
struct bfa_s *bfa;
struct bfa_pcidev_s pcidev;
struct bfa_timer_mod_s *timer_mod;
@@ -783,8 +787,10 @@ struct bfa_dconf_s {
};
#pragma pack()
+enum bfa_dconf_event;
+
struct bfa_dconf_mod_s {
- bfa_sm_t sm;
+ void (*sm)(struct bfa_dconf_mod_s *, enum bfa_dconf_event);
u8 instance;
bfa_boolean_t read_data_valid;
bfa_boolean_t min_cfg;
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 6fc34fb20f00..ea61d9d45cc6 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -209,7 +209,7 @@ static void bfa_fcport_ln_sm_up_dn_nf(struct bfa_fcport_ln_s *ln,
static void bfa_fcport_ln_sm_up_dn_up_nf(struct bfa_fcport_ln_s *ln,
enum bfa_fcport_ln_sm_event event);
-static struct bfa_sm_table_s hal_port_sm_table[] = {
+static struct fcport_sm_table_s hal_port_sm_table[] = {
{BFA_SM(bfa_fcport_sm_uninit), BFA_PORT_ST_UNINIT},
{BFA_SM(bfa_fcport_sm_enabling_qwait), BFA_PORT_ST_ENABLING_QWAIT},
{BFA_SM(bfa_fcport_sm_enabling), BFA_PORT_ST_ENABLING},
@@ -3559,7 +3559,7 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
fcport->event_arg.i2hmsg = i2hmsg;
bfa_trc(bfa, msg->mhdr.msg_id);
- bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm));
+ bfa_trc(bfa, fcport_sm_to_state(hal_port_sm_table, fcport->sm));
switch (msg->mhdr.msg_id) {
case BFI_FCPORT_I2H_ENABLE_RSP:
@@ -3994,7 +3994,7 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
- attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm);
+ attr->port_state = fcport_sm_to_state(hal_port_sm_table, fcport->sm);
attr->fec_state = fcport->fec_state;
@@ -4076,7 +4076,7 @@ bfa_fcport_is_disabled(struct bfa_s *bfa)
{
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
- return bfa_sm_to_state(hal_port_sm_table, fcport->sm) ==
+ return fcport_sm_to_state(hal_port_sm_table, fcport->sm) ==
BFA_PORT_ST_DISABLED;
}
@@ -4086,7 +4086,7 @@ bfa_fcport_is_dport(struct bfa_s *bfa)
{
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
- return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) ==
+ return (fcport_sm_to_state(hal_port_sm_table, fcport->sm) ==
BFA_PORT_ST_DPORT);
}
@@ -4095,7 +4095,7 @@ bfa_fcport_is_ddport(struct bfa_s *bfa)
{
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
- return (bfa_sm_to_state(hal_port_sm_table, fcport->sm) ==
+ return (fcport_sm_to_state(hal_port_sm_table, fcport->sm) ==
BFA_PORT_ST_DDPORT);
}
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index 7e8fb6231d49..c8798e3f50d2 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -160,6 +160,8 @@ struct bfa_fcxp_rsp_info_s {
u32 rsp_maxlen; /* max response length expected */
};
+typedef void (*bfa_sm_t)(void *sm, int event);
+
struct bfa_fcxp_s {
struct list_head qe; /* fcxp queue element */
bfa_sm_t sm; /* state machine */
@@ -295,9 +297,11 @@ struct bfa_rport_info_s {
/*
* BFA rport data structure
*/
+enum bfa_rport_event;
+
struct bfa_rport_s {
struct list_head qe; /* queue element */
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfa_rport_s *, enum bfa_rport_event);/* state machine */
struct bfa_s *bfa; /* backpointer to BFA */
void *rport_drv; /* fcs/driver rport object */
u16 fw_handle; /* firmware rport handle */
@@ -388,10 +392,12 @@ void bfa_uf_res_recfg(struct bfa_s *bfa, u16 num_uf_fw);
/*
* LPS - bfa lport login/logout service interface
*/
+enum bfa_lps_event;
+
struct bfa_lps_s {
struct list_head qe; /* queue element */
struct bfa_s *bfa; /* parent bfa instance */
- bfa_sm_t sm; /* finite state machine */
+ void (*sm)(struct bfa_lps_s *, enum bfa_lps_event);/* finite state machine */
u8 bfa_tag; /* lport tag */
u8 fw_tag; /* lport fw tag */
u8 reqq; /* lport request queue */
@@ -450,9 +456,11 @@ void bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
/*
* Link notification data structure
*/
+enum bfa_fcport_ln_sm_event;
+
struct bfa_fcport_ln_s {
struct bfa_fcport_s *fcport;
- bfa_sm_t sm;
+ void (*sm)(struct bfa_fcport_ln_s *, enum bfa_fcport_ln_sm_event);
struct bfa_cb_qe_s ln_qe; /* BFA callback queue elem for ln */
enum bfa_port_linkstate ln_event; /* ln event for callback */
};
@@ -466,7 +474,7 @@ struct bfa_fcport_trunk_s {
*/
struct bfa_fcport_s {
struct bfa_s *bfa; /* parent BFA instance */
- bfa_sm_t sm; /* port state machine */
+ void (*sm)(struct bfa_fcport_s *, enum bfa_fcport_sm_event); /* port state machine */
wwn_t nwwn; /* node wwn of physical port */
wwn_t pwwn; /* port wwn of physical oprt */
enum bfa_port_speed speed_sup;
@@ -714,9 +722,11 @@ struct bfa_fcdiag_lb_s {
u32 status;
};
+enum bfa_dport_sm_event;
+
struct bfa_dport_s {
struct bfa_s *bfa; /* Back pointer to BFA */
- bfa_sm_t sm; /* finite state machine */
+ void (*sm)(struct bfa_dport_s *, enum bfa_dport_sm_event);/* finite state machine */
struct bfa_reqq_wait_s reqq_wait;
bfa_cb_diag_t cbfn;
void *cbarg;
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index bd7e6a6fc1f1..f304faab15eb 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -408,6 +408,16 @@ bfad_hcb_comp(void *arg, bfa_status_t status)
complete(&fcomp->comp);
}
+void
+bfad_stats_comp(void *arg, bfa_boolean_t _status)
+{
+ struct bfad_hal_comp *fcomp = (struct bfad_hal_comp *)arg;
+ bfa_status_t status = (bfa_status_t)_status;
+
+ fcomp->status = status;
+ complete(&fcomp->comp);
+}
+
/*
* bfa_init callback
*/
@@ -1439,7 +1449,7 @@ bfad_pci_remove(struct pci_dev *pdev)
* PCI Error Recovery entry, error detected.
*/
static pci_ers_result_t
-bfad_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
+bfad_pci_error_detected(struct pci_dev *pdev, enum pci_channel_state state)
{
struct bfad_s *bfad = pci_get_drvdata(pdev);
unsigned long flags;
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index 5d163ca1b366..621829cd12bb 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -2143,7 +2143,7 @@ bfad_iocmd_fcport_get_stats(struct bfad_s *bfad, void *cmd)
struct bfa_cb_pending_q_s cb_qe;
init_completion(&fcomp.comp);
- bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp,
+ bfa_pending_q_init(&cb_qe, bfad_stats_comp,
&fcomp, &iocmd->stats);
spin_lock_irqsave(&bfad->bfad_lock, flags);
iocmd->status = bfa_fcport_get_stats(&bfad->bfa, &cb_qe);
@@ -2167,7 +2167,7 @@ bfad_iocmd_fcport_reset_stats(struct bfad_s *bfad, void *cmd)
struct bfa_cb_pending_q_s cb_qe;
init_completion(&fcomp.comp);
- bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp, &fcomp, NULL);
+ bfa_pending_q_init(&cb_qe, bfad_stats_comp, &fcomp, NULL);
spin_lock_irqsave(&bfad->bfad_lock, flags);
iocmd->status = bfa_fcport_clear_stats(&bfad->bfa, &cb_qe);
@@ -2451,7 +2451,7 @@ bfad_iocmd_qos_get_stats(struct bfad_s *bfad, void *cmd)
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa);
init_completion(&fcomp.comp);
- bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp,
+ bfa_pending_q_init(&cb_qe, bfad_stats_comp,
&fcomp, &iocmd->stats);
spin_lock_irqsave(&bfad->bfad_lock, flags);
@@ -2482,7 +2482,7 @@ bfad_iocmd_qos_reset_stats(struct bfad_s *bfad, void *cmd)
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa);
init_completion(&fcomp.comp);
- bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp,
+ bfa_pending_q_init(&cb_qe, bfad_stats_comp,
&fcomp, NULL);
spin_lock_irqsave(&bfad->bfad_lock, flags);
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index 4fe980a6441f..fb1ae8ddf84c 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -187,8 +187,10 @@ union bfad_tmp_buf {
/*
* BFAD (PCI function) data structure
*/
+enum bfad_sm_event;
+
struct bfad_s {
- bfa_sm_t sm; /* state machine */
+ void (*sm)(struct bfad_s *, enum bfad_sm_event); /* state machine */
struct list_head list_entry;
struct bfa_s bfa;
struct bfa_fcs_s bfa_fcs;
@@ -309,6 +311,7 @@ void bfad_fcs_stop(struct bfad_s *bfad);
void bfad_remove_intr(struct bfad_s *bfad);
void bfad_hal_mem_release(struct bfad_s *bfad);
void bfad_hcb_comp(void *arg, bfa_status_t status);
+void bfad_stats_comp(void *arg, bfa_boolean_t _status);
int bfad_setup_intr(struct bfad_s *bfad);
void bfad_remove_intr(struct bfad_s *bfad);
diff --git a/drivers/scsi/csiostor/csio_defs.h b/drivers/scsi/csiostor/csio_defs.h
index c38017b4af98..3268e62fdfaf 100644
--- a/drivers/scsi/csiostor/csio_defs.h
+++ b/drivers/scsi/csiostor/csio_defs.h
@@ -73,7 +73,8 @@ csio_list_deleted(struct list_head *list)
#define csio_list_prev(elem) (((struct list_head *)(elem))->prev)
/* State machine */
-typedef void (*csio_sm_state_t)(void *, uint32_t);
+struct csio_sm;
+typedef void (*csio_sm_state_t)(struct csio_sm *, uint32_t);
struct csio_sm {
struct list_head sm_list;
@@ -81,9 +82,9 @@ struct csio_sm {
};
static inline void
-csio_set_state(void *smp, void *state)
+csio_set_state(struct csio_sm *smp, csio_sm_state_t state)
{
- ((struct csio_sm *)smp)->sm_state = (csio_sm_state_t)state;
+ smp->sm_state = state;
}
static inline void
@@ -93,21 +94,21 @@ csio_init_state(struct csio_sm *smp, void *state)
}
static inline void
-csio_post_event(void *smp, uint32_t evt)
+csio_post_event(struct csio_sm *smp, uint32_t evt)
{
- ((struct csio_sm *)smp)->sm_state(smp, evt);
+ smp->sm_state(smp, evt);
}
static inline csio_sm_state_t
-csio_get_state(void *smp)
+csio_get_state(struct csio_sm *smp)
{
- return ((struct csio_sm *)smp)->sm_state;
+ return smp->sm_state;
}
static inline bool
-csio_match_state(void *smp, void *state)
+csio_match_state(struct csio_sm *smp, csio_sm_state_t state)
{
- return (csio_get_state(smp) == (csio_sm_state_t)state);
+ return (csio_get_state(smp) == state);
}
#define CSIO_ASSERT(cond) BUG_ON(!(cond))
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index e51923886475..db3fa6979474 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -89,15 +89,15 @@ static void csio_mgmtm_cleanup(struct csio_mgmtm *);
static void csio_hw_mbm_cleanup(struct csio_hw *);
/* State machine forward declarations */
-static void csio_hws_uninit(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_configuring(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_initializing(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_ready(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_quiescing(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_quiesced(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_resetting(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_removing(struct csio_hw *, enum csio_hw_ev);
-static void csio_hws_pcierr(struct csio_hw *, enum csio_hw_ev);
+static void csio_hws_uninit(struct csio_sm *, uint32_t);
+static void csio_hws_configuring(struct csio_sm *, uint32_t);
+static void csio_hws_initializing(struct csio_sm *, uint32_t);
+static void csio_hws_ready(struct csio_sm *, uint32_t);
+static void csio_hws_quiescing(struct csio_sm *, uint32_t);
+static void csio_hws_quiesced(struct csio_sm *, uint32_t);
+static void csio_hws_resetting(struct csio_sm *, uint32_t);
+static void csio_hws_removing(struct csio_sm *, uint32_t);
+static void csio_hws_pcierr(struct csio_sm *, uint32_t);
static void csio_hw_initialize(struct csio_hw *hw);
static void csio_evtq_stop(struct csio_hw *hw);
@@ -105,12 +105,12 @@ static void csio_evtq_start(struct csio_hw *hw);
int csio_is_hw_ready(struct csio_hw *hw)
{
- return csio_match_state(hw, csio_hws_ready);
+ return csio_match_state(&hw->sm, csio_hws_ready);
}
int csio_is_hw_removing(struct csio_hw *hw)
{
- return csio_match_state(hw, csio_hws_removing);
+ return csio_match_state(&hw->sm, csio_hws_removing);
}
@@ -2777,8 +2777,11 @@ csio_hw_fatal_err(struct csio_hw *hw)
*
*/
static void
-csio_hws_uninit(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_uninit(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -2802,8 +2805,11 @@ csio_hws_uninit(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_configuring(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_configuring(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -2840,8 +2846,11 @@ csio_hws_configuring(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_initializing(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_initializing(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -2878,8 +2887,11 @@ csio_hws_initializing(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_ready(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_ready(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
/* Remember the event */
hw->evtflag = evt;
@@ -2927,8 +2939,11 @@ csio_hws_ready(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_quiescing(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_quiescing(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -2987,8 +3002,11 @@ csio_hws_quiescing(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_quiesced(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_quiesced(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -3012,8 +3030,11 @@ csio_hws_quiesced(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_resetting(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_resetting(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -3038,8 +3059,11 @@ csio_hws_resetting(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_removing(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_removing(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -3073,8 +3097,11 @@ csio_hws_removing(struct csio_hw *hw, enum csio_hw_ev evt)
*
*/
static void
-csio_hws_pcierr(struct csio_hw *hw, enum csio_hw_ev evt)
+csio_hws_pcierr(struct csio_sm *_hw, uint32_t _evt)
{
+ struct csio_hw *hw = container_of(_hw, struct csio_hw, sm);
+ enum csio_hw_ev evt = _evt;
+
hw->prev_evt = hw->cur_evt;
hw->cur_evt = evt;
CSIO_INC_STATS(hw, n_evt_sm[evt]);
@@ -4231,7 +4258,7 @@ csio_hw_start(struct csio_hw *hw)
if (csio_is_hw_ready(hw))
return 0;
- else if (csio_match_state(hw, csio_hws_uninit))
+ else if (csio_match_state(&hw->sm, csio_hws_uninit))
return -EINVAL;
else
return -ENODEV;
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index ed2dae657964..621adf48e4a2 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -1062,7 +1062,7 @@ static void csio_remove_one(struct pci_dev *pdev)
*
*/
static pci_ers_result_t
-csio_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
+csio_pci_error_detected(struct pci_dev *pdev, enum pci_channel_state state)
{
struct csio_hw *hw = pci_get_drvdata(pdev);
diff --git a/drivers/scsi/csiostor/csio_lnode.c b/drivers/scsi/csiostor/csio_lnode.c
index cc5611efc7a9..1937cb0386bd 100644
--- a/drivers/scsi/csiostor/csio_lnode.c
+++ b/drivers/scsi/csiostor/csio_lnode.c
@@ -55,10 +55,10 @@ int csio_fdmi_enable = 1;
#define PORT_ID_PTR(_x) ((uint8_t *)(&_x) + 1)
/* Lnode SM declarations */
-static void csio_lns_uninit(struct csio_lnode *, enum csio_ln_ev);
-static void csio_lns_online(struct csio_lnode *, enum csio_ln_ev);
-static void csio_lns_ready(struct csio_lnode *, enum csio_ln_ev);
-static void csio_lns_offline(struct csio_lnode *, enum csio_ln_ev);
+static void csio_lns_uninit(struct csio_sm *, uint32_t);
+static void csio_lns_online(struct csio_sm *, uint32_t);
+static void csio_lns_ready(struct csio_sm *, uint32_t);
+static void csio_lns_offline(struct csio_sm *, uint32_t);
static int csio_ln_mgmt_submit_req(struct csio_ioreq *,
void (*io_cbfn) (struct csio_hw *, struct csio_ioreq *),
@@ -1092,7 +1092,7 @@ csio_handle_link_down(struct csio_hw *hw, uint8_t portid, uint32_t fcfi,
int
csio_is_lnode_ready(struct csio_lnode *ln)
{
- return (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready));
+ return (csio_get_state(&ln->sm) == csio_lns_ready);
}
/*****************************************************************************/
@@ -1108,8 +1108,10 @@ csio_is_lnode_ready(struct csio_lnode *ln)
* Return - none.
*/
static void
-csio_lns_uninit(struct csio_lnode *ln, enum csio_ln_ev evt)
+csio_lns_uninit(struct csio_sm *_ln, uint32_t _evt)
{
+ struct csio_lnode *ln = container_of(_ln, struct csio_lnode, sm);
+ enum csio_ln_ev evt = _evt;
struct csio_hw *hw = csio_lnode_to_hw(ln);
struct csio_lnode *rln = hw->rln;
int rv;
@@ -1161,8 +1163,10 @@ csio_lns_uninit(struct csio_lnode *ln, enum csio_ln_ev evt)
* Return - none.
*/
static void
-csio_lns_online(struct csio_lnode *ln, enum csio_ln_ev evt)
+csio_lns_online(struct csio_sm *_ln, uint32_t _evt)
{
+ struct csio_lnode *ln = container_of(_ln, struct csio_lnode, sm);
+ enum csio_ln_ev evt = _evt;
struct csio_hw *hw = csio_lnode_to_hw(ln);
CSIO_INC_STATS(ln, n_evt_sm[evt]);
@@ -1213,8 +1217,10 @@ csio_lns_online(struct csio_lnode *ln, enum csio_ln_ev evt)
* Return - none.
*/
static void
-csio_lns_ready(struct csio_lnode *ln, enum csio_ln_ev evt)
+csio_lns_ready(struct csio_sm *_ln, uint32_t _evt)
{
+ struct csio_lnode *ln = container_of(_ln, struct csio_lnode, sm);
+ enum csio_ln_ev evt = _evt;
struct csio_hw *hw = csio_lnode_to_hw(ln);
CSIO_INC_STATS(ln, n_evt_sm[evt]);
@@ -1287,8 +1293,10 @@ csio_lns_ready(struct csio_lnode *ln, enum csio_ln_ev evt)
* Return - none.
*/
static void
-csio_lns_offline(struct csio_lnode *ln, enum csio_ln_ev evt)
+csio_lns_offline(struct csio_sm *_ln, uint32_t _evt)
{
+ struct csio_lnode *ln = container_of(_ln, struct csio_lnode, sm);
+ enum csio_ln_ev evt = _evt;
struct csio_hw *hw = csio_lnode_to_hw(ln);
struct csio_lnode *rln = hw->rln;
int rv;
@@ -1364,15 +1372,15 @@ csio_free_fcfinfo(struct kref *kref)
void
csio_lnode_state_to_str(struct csio_lnode *ln, int8_t *str)
{
- if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_uninit)) {
+ if (csio_get_state(&ln->sm) == csio_lns_uninit) {
strcpy(str, "UNINIT");
return;
}
- if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_ready)) {
+ if (csio_get_state(&ln->sm) == csio_lns_ready) {
strcpy(str, "READY");
return;
}
- if (csio_get_state(ln) == ((csio_sm_state_t)csio_lns_offline)) {
+ if (csio_get_state(&ln->sm) == csio_lns_offline) {
strcpy(str, "OFFLINE");
return;
}
diff --git a/drivers/scsi/csiostor/csio_rnode.c b/drivers/scsi/csiostor/csio_rnode.c
index e9c3b045f587..4ba3a598df2f 100644
--- a/drivers/scsi/csiostor/csio_rnode.c
+++ b/drivers/scsi/csiostor/csio_rnode.c
@@ -46,10 +46,10 @@ static int csio_rnode_init(struct csio_rnode *, struct csio_lnode *);
static void csio_rnode_exit(struct csio_rnode *);
/* Static machine forward declarations */
-static void csio_rns_uninit(struct csio_rnode *, enum csio_rn_ev);
-static void csio_rns_ready(struct csio_rnode *, enum csio_rn_ev);
-static void csio_rns_offline(struct csio_rnode *, enum csio_rn_ev);
-static void csio_rns_disappeared(struct csio_rnode *, enum csio_rn_ev);
+static void csio_rns_uninit(struct csio_sm *, uint32_t);
+static void csio_rns_ready(struct csio_sm *, uint32_t);
+static void csio_rns_offline(struct csio_sm *, uint32_t);
+static void csio_rns_disappeared(struct csio_sm *, uint32_t);
/* RNF event mapping */
static enum csio_rn_ev fwevt_to_rnevt[] = {
@@ -88,13 +88,13 @@ static enum csio_rn_ev fwevt_to_rnevt[] = {
int
csio_is_rnode_ready(struct csio_rnode *rn)
{
- return csio_match_state(rn, csio_rns_ready);
+ return csio_match_state(&rn->sm, csio_rns_ready);
}
static int
csio_is_rnode_uninit(struct csio_rnode *rn)
{
- return csio_match_state(rn, csio_rns_uninit);
+ return csio_match_state(&rn->sm, csio_rns_uninit);
}
static int
@@ -601,8 +601,10 @@ __csio_unreg_rnode(struct csio_rnode *rn)
*
*/
static void
-csio_rns_uninit(struct csio_rnode *rn, enum csio_rn_ev evt)
+csio_rns_uninit(struct csio_sm *_rn, uint32_t _evt)
{
+ struct csio_rnode *rn = container_of(_rn, struct csio_rnode, sm);
+ enum csio_rn_ev evt = _evt;
struct csio_lnode *ln = csio_rnode_to_lnode(rn);
int ret = 0;
@@ -641,8 +643,10 @@ csio_rns_uninit(struct csio_rnode *rn, enum csio_rn_ev evt)
*
*/
static void
-csio_rns_ready(struct csio_rnode *rn, enum csio_rn_ev evt)
+csio_rns_ready(struct csio_sm *_rn, uint32_t _evt)
{
+ struct csio_rnode *rn = container_of(_rn, struct csio_rnode, sm);
+ enum csio_rn_ev evt = _evt;
struct csio_lnode *ln = csio_rnode_to_lnode(rn);
int ret = 0;
@@ -726,8 +730,10 @@ csio_rns_ready(struct csio_rnode *rn, enum csio_rn_ev evt)
*
*/
static void
-csio_rns_offline(struct csio_rnode *rn, enum csio_rn_ev evt)
+csio_rns_offline(struct csio_sm *_rn, uint32_t _evt)
{
+ struct csio_rnode *rn = container_of(_rn, struct csio_rnode, sm);
+ enum csio_rn_ev evt = _evt;
struct csio_lnode *ln = csio_rnode_to_lnode(rn);
int ret = 0;
@@ -785,8 +791,10 @@ csio_rns_offline(struct csio_rnode *rn, enum csio_rn_ev evt)
*
*/
static void
-csio_rns_disappeared(struct csio_rnode *rn, enum csio_rn_ev evt)
+csio_rns_disappeared(struct csio_sm *_rn, uint32_t _evt)
{
+ struct csio_rnode *rn = container_of(_rn, struct csio_rnode, sm);
+ enum csio_rn_ev evt = _evt;
struct csio_lnode *ln = csio_rnode_to_lnode(rn);
int ret = 0;
diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index dab0d3f9bee1..770ffbf86037 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -65,12 +65,12 @@ static int csio_ddp_descs = 128;
static int csio_do_abrt_cls(struct csio_hw *,
struct csio_ioreq *, bool);
-static void csio_scsis_uninit(struct csio_ioreq *, enum csio_scsi_ev);
-static void csio_scsis_io_active(struct csio_ioreq *, enum csio_scsi_ev);
-static void csio_scsis_tm_active(struct csio_ioreq *, enum csio_scsi_ev);
-static void csio_scsis_aborting(struct csio_ioreq *, enum csio_scsi_ev);
-static void csio_scsis_closing(struct csio_ioreq *, enum csio_scsi_ev);
-static void csio_scsis_shost_cmpl_await(struct csio_ioreq *, enum csio_scsi_ev);
+static void csio_scsis_uninit(struct csio_sm *, uint32_t);
+static void csio_scsis_io_active(struct csio_sm *, uint32_t);
+static void csio_scsis_tm_active(struct csio_sm *, uint32_t);
+static void csio_scsis_aborting(struct csio_sm *, uint32_t);
+static void csio_scsis_closing(struct csio_sm *, uint32_t);
+static void csio_scsis_shost_cmpl_await(struct csio_sm *, uint32_t);
/*
* csio_scsi_match_io - Match an ioreq with the given SCSI level data.
@@ -700,8 +700,10 @@ csio_scsi_abrt_cls(struct csio_ioreq *req, bool abort)
/* START: SCSI SM */
/*****************************************************************************/
static void
-csio_scsis_uninit(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_uninit(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
struct csio_hw *hw = req->lnode->hwp;
struct csio_scsim *scsim = csio_hw_to_scsim(hw);
@@ -770,8 +772,10 @@ csio_scsis_uninit(struct csio_ioreq *req, enum csio_scsi_ev evt)
}
static void
-csio_scsis_io_active(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_io_active(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
struct csio_hw *hw = req->lnode->hwp;
struct csio_scsim *scm = csio_hw_to_scsim(hw);
struct csio_rnode *rn;
@@ -842,8 +846,10 @@ csio_scsis_io_active(struct csio_ioreq *req, enum csio_scsi_ev evt)
}
static void
-csio_scsis_tm_active(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_tm_active(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
struct csio_hw *hw = req->lnode->hwp;
struct csio_scsim *scm = csio_hw_to_scsim(hw);
@@ -885,8 +891,10 @@ csio_scsis_tm_active(struct csio_ioreq *req, enum csio_scsi_ev evt)
}
static void
-csio_scsis_aborting(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_aborting(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
struct csio_hw *hw = req->lnode->hwp;
struct csio_scsim *scm = csio_hw_to_scsim(hw);
@@ -982,8 +990,10 @@ csio_scsis_aborting(struct csio_ioreq *req, enum csio_scsi_ev evt)
}
static void
-csio_scsis_closing(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_closing(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
struct csio_hw *hw = req->lnode->hwp;
struct csio_scsim *scm = csio_hw_to_scsim(hw);
@@ -1046,8 +1056,11 @@ csio_scsis_closing(struct csio_ioreq *req, enum csio_scsi_ev evt)
}
static void
-csio_scsis_shost_cmpl_await(struct csio_ioreq *req, enum csio_scsi_ev evt)
+csio_scsis_shost_cmpl_await(struct csio_sm *_req, uint32_t _evt)
{
+ struct csio_ioreq *req = container_of(_req, struct csio_ioreq, sm);
+ enum csio_scsi_ev evt = _evt;
+
switch (evt) {
case CSIO_SCSIE_ABORT:
case CSIO_SCSIE_CLOSE:
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 7d4f26198573..405f3c1034aa 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -260,12 +260,12 @@ int afs_fetch_data(struct afs_vnode *vnode, struct key *key, struct afs_read *de
/*
* read page from file, directory or symlink, given a key to use
*/
-int afs_page_filler(void *data, struct page *page)
+int afs_page_filler(struct file *data, struct page *page)
{
struct inode *inode = page->mapping->host;
struct afs_vnode *vnode = AFS_FS_I(inode);
struct afs_read *req;
- struct key *key = data;
+ struct key *key = (struct file *)data;
int ret;
_enter("{%x},{%lu},{%lu}", key_serial(key), inode->i_ino, page->index);
@@ -384,14 +384,14 @@ static int afs_readpage(struct file *file, struct page *page)
if (file) {
key = afs_file_key(file);
ASSERT(key != NULL);
- ret = afs_page_filler(key, page);
+ ret = afs_page_filler((struct file *)key, page);
} else {
struct inode *inode = page->mapping->host;
key = afs_request_key(AFS_FS_S(inode->i_sb)->cell);
if (IS_ERR(key)) {
ret = PTR_ERR(key);
} else {
- ret = afs_page_filler(key, page);
+ ret = afs_page_filler((struct file *)key, page);
key_put(key);
}
}
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 34c02fdcc25f..75d263c80703 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -752,7 +752,7 @@ extern void afs_put_wb_key(struct afs_wb_key *);
extern int afs_open(struct inode *, struct file *);
extern int afs_release(struct inode *, struct file *);
extern int afs_fetch_data(struct afs_vnode *, struct key *, struct afs_read *);
-extern int afs_page_filler(void *, struct page *);
+extern int afs_page_filler(struct file *, struct page *);
extern void afs_put_read(struct afs_read *);
/*
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c
index 5f81fcd383a4..b022ac3aeaf8 100644
--- a/fs/exofs/inode.c
+++ b/fs/exofs/inode.c
@@ -470,6 +470,11 @@ static int readpage_strip(void *data, struct page *page)
return ret;
}
+static int readpage_filler(struct file *data, struct page *page)
+{
+ return readpage_strip(data, page);
+}
+
static int exofs_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
@@ -478,7 +483,7 @@ static int exofs_readpages(struct file *file, struct address_space *mapping,
_pcol_init(&pcol, nr_pages, mapping->host);
- ret = read_cache_pages(mapping, pages, readpage_strip, &pcol);
+ ret = read_cache_pages(mapping, pages, readpage_filler, &pcol);
if (ret) {
EXOFS_ERR("read_cache_pages => %d\n", ret);
return ret;
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 32d0b883e74f..5e1177754944 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -838,9 +838,9 @@ struct fuse_fill_data {
unsigned nr_pages;
};
-static int fuse_readpages_fill(void *_data, struct page *page)
+static int fuse_readpages_fill(struct file *_data, struct page *page)
{
- struct fuse_fill_data *data = _data;
+ struct fuse_fill_data *data = (struct fuse_fill_data *)_data;
struct fuse_req *req = data->req;
struct inode *inode = data->inode;
struct fuse_conn *fc = get_fuse_conn(inode);
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 8bfaa658b2c1..6181e11b7480 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -664,8 +664,9 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
* We only need to convert from xdr once so future lookups are much simpler
*/
static
-int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page)
+int nfs_readdir_filler(struct file *_desc, struct page* page)
{
+ nfs_readdir_descriptor_t *desc = (nfs_readdir_descriptor_t *)_desc;
struct inode *inode = file_inode(desc->file);
int ret;
@@ -698,7 +699,7 @@ static
struct page *get_cache_page(nfs_readdir_descriptor_t *desc)
{
return read_cache_page(desc->file->f_mapping,
- desc->page_index, (filler_t *)nfs_readdir_filler, desc);
+ desc->page_index, nfs_readdir_filler, desc);
}
/*
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 48d7277c60a9..42dbf4f4d5aa 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -354,7 +354,7 @@ struct nfs_readdesc {
};
static int
-readpage_async_filler(void *data, struct page *page)
+readpage_async_filler(struct file *data, struct page *page)
{
struct nfs_readdesc *desc = (struct nfs_readdesc *)data;
struct nfs_page *new;
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 06eb44b47885..53274f818d38 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -26,9 +26,10 @@
* and straight-forward than readdir caching.
*/
-static int nfs_symlink_filler(struct inode *inode, struct page *page)
+static int nfs_symlink_filler(struct file *_inode, struct page *page)
{
int error;
+ struct inode *inode = (struct inode *)_inode;
error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE);
if (error < 0)
@@ -65,8 +66,7 @@ static const char *nfs_get_link(struct dentry *dentry,
err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
if (err)
return err;
- page = read_cache_page(&inode->i_data, 0,
- (filler_t *)nfs_symlink_filler, inode);
+ page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler, inode);
if (IS_ERR(page))
return ERR_CAST(page);
}
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 418fa9c78186..a0c8bf2bd9bf 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -496,8 +496,9 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval,
}
static __be32
-nfsd4_decode_stateid(struct nfsd4_compoundargs *argp, stateid_t *sid)
+nfsd4_decode_stateid(struct nfsd4_compoundargs *argp, void *_sid)
{
+ stateid_t *sid = _sid;
DECODE_HEAD;
READ_BUF(sizeof(stateid_t));
@@ -508,8 +509,9 @@ nfsd4_decode_stateid(struct nfsd4_compoundargs *argp, stateid_t *sid)
}
static __be32
-nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access)
+nfsd4_decode_access(struct nfsd4_compoundargs *argp, void *_access)
{
+ struct nfsd4_access *access = _access;
DECODE_HEAD;
READ_BUF(4);
@@ -518,8 +520,9 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
DECODE_TAIL;
}
-static __be32 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_cb_sec *cbs)
+static __be32 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, void *_cbs)
{
+ struct nfsd4_cb_sec *cbs = _cbs;
DECODE_HEAD;
u32 dummy, uid, gid;
char *machine_name;
@@ -598,8 +601,9 @@ static __be32 nfsd4_decode_cb_sec(struct nfsd4_compoundargs *argp, struct nfsd4_
DECODE_TAIL;
}
-static __be32 nfsd4_decode_backchannel_ctl(struct nfsd4_compoundargs *argp, struct nfsd4_backchannel_ctl *bc)
+static __be32 nfsd4_decode_backchannel_ctl(struct nfsd4_compoundargs *argp, void *_bc)
{
+ struct nfsd4_backchannel_ctl *bc = _bc;
DECODE_HEAD;
READ_BUF(4);
@@ -609,8 +613,9 @@ static __be32 nfsd4_decode_backchannel_ctl(struct nfsd4_compoundargs *argp, stru
DECODE_TAIL;
}
-static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp, struct nfsd4_bind_conn_to_session *bcts)
+static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp, void *_bcts)
{
+ struct nfsd4_bind_conn_to_session *bcts = _bcts;
DECODE_HEAD;
READ_BUF(NFS4_MAX_SESSIONID_LEN + 8);
@@ -622,8 +627,9 @@ static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp,
}
static __be32
-nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
+nfsd4_decode_close(struct nfsd4_compoundargs *argp, void *_close)
{
+ struct nfsd4_close *close = _close;
DECODE_HEAD;
READ_BUF(4);
@@ -635,8 +641,9 @@ nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
static __be32
-nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit)
+nfsd4_decode_commit(struct nfsd4_compoundargs *argp, void *_commit)
{
+ struct nfsd4_commit *commit = _commit;
DECODE_HEAD;
READ_BUF(12);
@@ -647,8 +654,9 @@ nfsd4_decode_commit(struct nfsd4_compoundargs *argp, struct nfsd4_commit *commit
}
static __be32
-nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create)
+nfsd4_decode_create(struct nfsd4_compoundargs *argp, void *_create)
{
+ struct nfsd4_create *create = _create;
DECODE_HEAD;
READ_BUF(4);
@@ -692,20 +700,25 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
}
static inline __be32
-nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr)
+nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, void *_dr)
{
+ struct nfsd4_delegreturn *dr = _dr;
+
return nfsd4_decode_stateid(argp, &dr->dr_stateid);
}
static inline __be32
-nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr)
+nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, void *_getattr)
{
+ struct nfsd4_getattr *getattr = _getattr;
+
return nfsd4_decode_bitmap(argp, getattr->ga_bmval);
}
static __be32
-nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
+nfsd4_decode_link(struct nfsd4_compoundargs *argp, void *_link)
{
+ struct nfsd4_link *link = _link;
DECODE_HEAD;
READ_BUF(4);
@@ -719,8 +732,9 @@ nfsd4_decode_link(struct nfsd4_compoundargs *argp, struct nfsd4_link *link)
}
static __be32
-nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
+nfsd4_decode_lock(struct nfsd4_compoundargs *argp, void *_lock)
{
+ struct nfsd4_lock *lock = _lock;
DECODE_HEAD;
/*
@@ -759,8 +773,9 @@ nfsd4_decode_lock(struct nfsd4_compoundargs *argp, struct nfsd4_lock *lock)
}
static __be32
-nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
+nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, void *_lockt)
{
+ struct nfsd4_lockt *lockt = _lockt;
DECODE_HEAD;
READ_BUF(32);
@@ -778,8 +793,9 @@ nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
}
static __be32
-nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
+nfsd4_decode_locku(struct nfsd4_compoundargs *argp, void *_locku)
{
+ struct nfsd4_locku *locku = _locku;
DECODE_HEAD;
READ_BUF(8);
@@ -798,8 +814,9 @@ nfsd4_decode_locku(struct nfsd4_compoundargs *argp, struct nfsd4_locku *locku)
}
static __be32
-nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, struct nfsd4_lookup *lookup)
+nfsd4_decode_lookup(struct nfsd4_compoundargs *argp, void *_lookup)
{
+ struct nfsd4_lookup *lookup = _lookup;
DECODE_HEAD;
READ_BUF(4);
@@ -897,8 +914,9 @@ static __be32 nfsd4_decode_opaque(struct nfsd4_compoundargs *argp, struct xdr_ne
}
static __be32
-nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
+nfsd4_decode_open(struct nfsd4_compoundargs *argp, void *_open)
{
+ struct nfsd4_open *open = _open;
DECODE_HEAD;
u32 dummy;
@@ -1012,8 +1030,9 @@ nfsd4_decode_open(struct nfsd4_compoundargs *argp, struct nfsd4_open *open)
}
static __be32
-nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_confirm *open_conf)
+nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, void *_open_conf)
{
+ struct nfsd4_open_confirm *open_conf = _open_conf;
DECODE_HEAD;
if (argp->minorversion >= 1)
@@ -1029,8 +1048,9 @@ nfsd4_decode_open_confirm(struct nfsd4_compoundargs *argp, struct nfsd4_open_con
}
static __be32
-nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_downgrade *open_down)
+nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, void *_open_down)
{
+ struct nfsd4_open_downgrade *open_down = _open_down;
DECODE_HEAD;
status = nfsd4_decode_stateid(argp, &open_down->od_stateid);
@@ -1049,8 +1069,9 @@ nfsd4_decode_open_downgrade(struct nfsd4_compoundargs *argp, struct nfsd4_open_d
}
static __be32
-nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, struct nfsd4_putfh *putfh)
+nfsd4_decode_putfh(struct nfsd4_compoundargs *argp, void *_putfh)
{
+ struct nfsd4_putfh *putfh = _putfh;
DECODE_HEAD;
READ_BUF(4);
@@ -1072,8 +1093,9 @@ nfsd4_decode_putpubfh(struct nfsd4_compoundargs *argp, void *p)
}
static __be32
-nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
+nfsd4_decode_read(struct nfsd4_compoundargs *argp, void *_read)
{
+ struct nfsd4_read *read = _read;
DECODE_HEAD;
status = nfsd4_decode_stateid(argp, &read->rd_stateid);
@@ -1087,8 +1109,9 @@ nfsd4_decode_read(struct nfsd4_compoundargs *argp, struct nfsd4_read *read)
}
static __be32
-nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *readdir)
+nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, void *_readdir)
{
+ struct nfsd4_readdir *readdir = _readdir;
DECODE_HEAD;
READ_BUF(24);
@@ -1103,8 +1126,9 @@ nfsd4_decode_readdir(struct nfsd4_compoundargs *argp, struct nfsd4_readdir *read
}
static __be32
-nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove)
+nfsd4_decode_remove(struct nfsd4_compoundargs *argp, void *_remove)
{
+ struct nfsd4_remove *remove = _remove;
DECODE_HEAD;
READ_BUF(4);
@@ -1118,8 +1142,9 @@ nfsd4_decode_remove(struct nfsd4_compoundargs *argp, struct nfsd4_remove *remove
}
static __be32
-nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename)
+nfsd4_decode_rename(struct nfsd4_compoundargs *argp, void *_rename)
{
+ struct nfsd4_rename *rename = _rename;
DECODE_HEAD;
READ_BUF(4);
@@ -1139,7 +1164,7 @@ nfsd4_decode_rename(struct nfsd4_compoundargs *argp, struct nfsd4_rename *rename
}
static __be32
-nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
+nfsd4_decode_renew(struct nfsd4_compoundargs *argp, void *clientid)
{
DECODE_HEAD;
@@ -1154,8 +1179,9 @@ nfsd4_decode_renew(struct nfsd4_compoundargs *argp, clientid_t *clientid)
static __be32
nfsd4_decode_secinfo(struct nfsd4_compoundargs *argp,
- struct nfsd4_secinfo *secinfo)
+ void *_secinfo)
{
+ struct nfsd4_secinfo *secinfo = _secinfo;
DECODE_HEAD;
READ_BUF(4);
@@ -1170,8 +1196,9 @@ nfsd4_decode_secinfo(struct nfsd4_compoundargs *argp,
static __be32
nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp,
- struct nfsd4_secinfo_no_name *sin)
+ void *_sin)
{
+ struct nfsd4_secinfo_no_name *sin = _sin;
DECODE_HEAD;
READ_BUF(4);
@@ -1180,8 +1207,9 @@ nfsd4_decode_secinfo_no_name(struct nfsd4_compoundargs *argp,
}
static __be32
-nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *setattr)
+nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, void *_setattr)
{
+ struct nfsd4_setattr *setattr = _setattr;
__be32 status;
status = nfsd4_decode_stateid(argp, &setattr->sa_stateid);
@@ -1192,8 +1220,9 @@ nfsd4_decode_setattr(struct nfsd4_compoundargs *argp, struct nfsd4_setattr *seta
}
static __be32
-nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, struct nfsd4_setclientid *setclientid)
+nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, void *_setclientid)
{
+ struct nfsd4_setclientid *setclientid = _setclientid;
DECODE_HEAD;
if (argp->minorversion >= 1)
@@ -1222,8 +1251,9 @@ nfsd4_decode_setclientid(struct nfsd4_compoundargs *argp, st