^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Linux MegaRAID device driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (c) 2003-2004 LSI Logic Corporation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * FILE : megaraid_mm.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef MEGARAID_MM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define MEGARAID_MM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/moduleparam.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/pci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/miscdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include "mbox_defs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include "megaraid_ioctl.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define LSI_COMMON_MOD_VERSION "2.20.2.7"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define LSI_COMMON_MOD_EXT_VERSION \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) "(Release Date: Sun Jul 16 00:01:03 EST 2006)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define LSI_DBGLVL dbglevel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) // The smallest dma pool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define MRAID_MM_INIT_BUFF_SIZE 4096
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * mimd_t : Old style ioctl packet structure (deprecated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * @inlen :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * @outlen :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * @fca :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * @opcode :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * @subopcode :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * @adapno :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * @buffer :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * @pad :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * @length :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * @mbox :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * @pthru :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * @data :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * @pad :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * Note : This structure is DEPRECATED. New applications must use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * : uioc_t structure instead. All new hba drivers use the new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * : format. If we get this mimd packet, we will convert it into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * : new uioc_t format and send it to the hba drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) typedef struct mimd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) uint32_t inlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) uint32_t outlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) uint8_t fca[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) uint8_t opcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) uint8_t subopcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) uint16_t adapno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #if BITS_PER_LONG == 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) uint8_t __user *buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) uint8_t pad[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #if BITS_PER_LONG == 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) uint8_t __user *buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) uint32_t length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) } __attribute__ ((packed)) fcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) } __attribute__ ((packed)) ui;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) uint8_t mbox[18]; /* 16 bytes + 2 status bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) mraid_passthru_t pthru;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #if BITS_PER_LONG == 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) char __user *data; /* buffer <= 4096 for 0x80 commands */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) char pad[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) #if BITS_PER_LONG == 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) char __user *data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) } __attribute__ ((packed))mimd_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) #endif // MEGARAID_MM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) // vi: set ts=8 sw=8 tw=78: