Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: gpib: Remove unneeded enums and functions

Remove enums and functions that do not need to be shared
with user space.

Remove enums and functions that are not needed in the kernel drivers.

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250603184320.30594-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dave Penkler and committed by
Greg Kroah-Hartman
3fb68dd9 b940fd6c

-198
-198
drivers/staging/gpib/uapi/gpib.h
··· 83 83 BUS_EOI = 0x8000 /* EOI line status bit */ 84 84 }; 85 85 86 - /* Possible GPIB command messages */ 87 - 88 - enum cmd_byte { 89 - GTL = 0x1, /* go to local */ 90 - SDC = 0x4, /* selected device clear */ 91 - PP_CONFIG = 0x5, 92 - #ifndef PPC 93 - PPC = PP_CONFIG, /* parallel poll configure */ 94 - #endif 95 - GET = 0x8, /* group execute trigger */ 96 - TCT = 0x9, /* take control */ 97 - LLO = 0x11, /* local lockout */ 98 - DCL = 0x14, /* device clear */ 99 - PPU = 0x15, /* parallel poll unconfigure */ 100 - SPE = 0x18, /* serial poll enable */ 101 - SPD = 0x19, /* serial poll disable */ 102 - CFE = 0x1f, /* configure enable */ 103 - LAD = 0x20, /* value to be 'ored' in to obtain listen address */ 104 - UNL = 0x3F, /* unlisten */ 105 - TAD = 0x40, /* value to be 'ored' in to obtain talk address */ 106 - UNT = 0x5F, /* untalk */ 107 - SAD = 0x60, /* my secondary address (base) */ 108 - PPE = 0x60, /* parallel poll enable (base) */ 109 - PPD = 0x70 /* parallel poll disable */ 110 - }; 111 - 112 86 enum ppe_bits { 113 87 PPC_DISABLE = 0x10, 114 88 PPC_SENSE = 0x8, /* parallel poll sense bit */ 115 89 PPC_DIO_MASK = 0x7 116 - }; 117 - 118 - /* confine address to range 0 to 30. */ 119 - static inline unsigned int gpib_address_restrict(unsigned int addr) 120 - { 121 - addr &= 0x1f; 122 - if (addr == 0x1f) 123 - addr = 0; 124 - return addr; 125 - } 126 - 127 - static inline __u8 MLA(unsigned int addr) 128 - { 129 - return gpib_address_restrict(addr) | LAD; 130 - } 131 - 132 - static inline __u8 MTA(unsigned int addr) 133 - { 134 - return gpib_address_restrict(addr) | TAD; 135 - } 136 - 137 - static inline __u8 MSA(unsigned int addr) 138 - { 139 - return (addr & 0x1f) | SAD; 140 - } 141 - 142 - static inline __u8 PPE_byte(unsigned int dio_line, int sense) 143 - { 144 - __u8 cmd; 145 - 146 - cmd = PPE; 147 - if (sense) 148 - cmd |= PPC_SENSE; 149 - cmd |= (dio_line - 1) & 0x7; 150 - return cmd; 151 - } 152 - 153 - /* mask of bits that actually matter in a command byte */ 154 - enum { 155 - gpib_command_mask = 0x7f, 156 - }; 157 - 158 - static inline int is_PPE(__u8 command) 159 - { 160 - return (command & 0x70) == 0x60; 161 - } 162 - 163 - static inline int is_PPD(__u8 command) 164 - { 165 - return (command & 0x70) == 0x70; 166 - } 167 - 168 - static inline int in_addressed_command_group(__u8 command) 169 - { 170 - return (command & 0x70) == 0x0; 171 - } 172 - 173 - static inline int in_universal_command_group(__u8 command) 174 - { 175 - return (command & 0x70) == 0x10; 176 - } 177 - 178 - static inline int in_listen_address_group(__u8 command) 179 - { 180 - return (command & 0x60) == 0x20; 181 - } 182 - 183 - static inline int in_talk_address_group(__u8 command) 184 - { 185 - return (command & 0x60) == 0x40; 186 - } 187 - 188 - static inline int in_primary_command_group(__u8 command) 189 - { 190 - return in_addressed_command_group(command) || 191 - in_universal_command_group(command) || 192 - in_listen_address_group(command) || 193 - in_talk_address_group(command); 194 - } 195 - 196 - static inline int gpib_address_equal(unsigned int pad1, int sad1, unsigned int pad2, int sad2) 197 - { 198 - if (pad1 == pad2) { 199 - if (sad1 == sad2) 200 - return 1; 201 - if (sad1 < 0 && sad2 < 0) 202 - return 1; 203 - } 204 - 205 - return 0; 206 - } 207 - 208 - enum ibask_option { 209 - IBA_PAD = 0x1, 210 - IBA_SAD = 0x2, 211 - IBA_TMO = 0x3, 212 - IBA_EOT = 0x4, 213 - IBA_PPC = 0x5, /* board only */ 214 - IBA_READ_DR = 0x6, /* device only */ 215 - IBA_AUTOPOLL = 0x7, /* board only */ 216 - IBA_CICPROT = 0x8, /* board only */ 217 - IBA_IRQ = 0x9, /* board only */ 218 - IBA_SC = 0xa, /* board only */ 219 - IBA_SRE = 0xb, /* board only */ 220 - IBA_EOS_RD = 0xc, 221 - IBA_EOS_WRT = 0xd, 222 - IBA_EOS_CMP = 0xe, 223 - IBA_EOS_CHAR = 0xf, 224 - IBA_PP2 = 0x10, /* board only */ 225 - IBA_TIMING = 0x11, /* board only */ 226 - IBA_DMA = 0x12, /* board only */ 227 - IBA_READ_ADJUST = 0x13, 228 - IBA_WRITE_ADJUST = 0x14, 229 - IBA_EVENT_QUEUE = 0x15, /* board only */ 230 - IBA_SPOLL_BIT = 0x16, /* board only */ 231 - IBA_SEND_LLO = 0x17, /* board only */ 232 - IBA_SPOLL_TIME = 0x18, /* device only */ 233 - IBA_PPOLL_TIME = 0x19, /* board only */ 234 - IBA_END_BIT_IS_NORMAL = 0x1a, 235 - IBA_UN_ADDR = 0x1b, /* device only */ 236 - IBA_HS_CABLE_LENGTH = 0x1f, /* board only */ 237 - IBA_IST = 0x20, /* board only */ 238 - IBA_RSV = 0x21, /* board only */ 239 - IBA_BNA = 0x200, /* device only */ 240 - /* linux-gpib extensions */ 241 - IBA_7_BIT_EOS = 0x1000 /* board only. Returns 1 if board supports 7 bit eos compares*/ 242 - }; 243 - 244 - enum ibconfig_option { 245 - IBC_PAD = 0x1, 246 - IBC_SAD = 0x2, 247 - IBC_TMO = 0x3, 248 - IBC_EOT = 0x4, 249 - IBC_PPC = 0x5, /* board only */ 250 - IBC_READDR = 0x6, /* device only */ 251 - IBC_AUTOPOLL = 0x7, /* board only */ 252 - IBC_CICPROT = 0x8, /* board only */ 253 - IBC_IRQ = 0x9, /* board only */ 254 - IBC_SC = 0xa, /* board only */ 255 - IBC_SRE = 0xb, /* board only */ 256 - IBC_EOS_RD = 0xc, 257 - IBC_EOS_WRT = 0xd, 258 - IBC_EOS_CMP = 0xe, 259 - IBC_EOS_CHAR = 0xf, 260 - IBC_PP2 = 0x10, /* board only */ 261 - IBC_TIMING = 0x11, /* board only */ 262 - IBC_DMA = 0x12, /* board only */ 263 - IBC_READ_ADJUST = 0x13, 264 - IBC_WRITE_ADJUST = 0x14, 265 - IBC_EVENT_QUEUE = 0x15, /* board only */ 266 - IBC_SPOLL_BIT = 0x16, /* board only */ 267 - IBC_SEND_LLO = 0x17, /* board only */ 268 - IBC_SPOLL_TIME = 0x18, /* device only */ 269 - IBC_PPOLL_TIME = 0x19, /* board only */ 270 - IBC_END_BIT_IS_NORMAL = 0x1a, 271 - IBC_UN_ADDR = 0x1b, /* device only */ 272 - IBC_HS_CABLE_LENGTH = 0x1f, /* board only */ 273 - IBC_IST = 0x20, /* board only */ 274 - IBC_RSV = 0x21, /* board only */ 275 - IBC_BNA = 0x200 /* device only */ 276 - }; 277 - 278 - enum t1_delays { 279 - T1_DELAY_2000ns = 1, 280 - T1_DELAY_500ns = 2, 281 - T1_DELAY_350ns = 3 282 90 }; 283 91 284 92 enum { ··· 98 290 EVENT_DEV_TRG = 1, 99 291 EVENT_DEV_CLR = 2, 100 292 EVENT_IFC = 3 101 - }; 102 - 103 - enum gpib_stb { 104 - IB_STB_RQS = 0x40, /* IEEE 488.1 & 2 */ 105 - IB_STB_ESB = 0x20, /* IEEE 488.2 only */ 106 - IB_STB_MAV = 0x10 /* IEEE 488.2 only */ 107 293 }; 108 294 109 295 #endif /* _GPIB_H */