internal.h (188de5dd80b2b7986e75821374efb67081049b6e) | internal.h (9771b8ccdfa6dcb1ac5128ca7fe8649f3092d392) |
---|---|
1/* 2 * Copyright Gavin Shan, IBM Corporation 2016. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ --- 161 unchanged lines hidden (view full) --- 170struct ncsi_dev_priv; 171struct ncsi_package; 172 173#define NCSI_PACKAGE_SHIFT 5 174#define NCSI_PACKAGE_INDEX(c) (((c) >> NCSI_PACKAGE_SHIFT) & 0x7) 175#define NCSI_RESERVED_CHANNEL 0x1f 176#define NCSI_CHANNEL_INDEX(c) ((c) & ((1 << NCSI_PACKAGE_SHIFT) - 1)) 177#define NCSI_TO_CHANNEL(p, c) (((p) << NCSI_PACKAGE_SHIFT) | (c)) | 1/* 2 * Copyright Gavin Shan, IBM Corporation 2016. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ --- 161 unchanged lines hidden (view full) --- 170struct ncsi_dev_priv; 171struct ncsi_package; 172 173#define NCSI_PACKAGE_SHIFT 5 174#define NCSI_PACKAGE_INDEX(c) (((c) >> NCSI_PACKAGE_SHIFT) & 0x7) 175#define NCSI_RESERVED_CHANNEL 0x1f 176#define NCSI_CHANNEL_INDEX(c) ((c) & ((1 << NCSI_PACKAGE_SHIFT) - 1)) 177#define NCSI_TO_CHANNEL(p, c) (((p) << NCSI_PACKAGE_SHIFT) | (c)) |
178#define NCSI_MAX_PACKAGE 8 179#define NCSI_MAX_CHANNEL 32 |
|
178 179struct ncsi_channel { 180 unsigned char id; 181 int state; 182#define NCSI_CHANNEL_INACTIVE 1 183#define NCSI_CHANNEL_ACTIVE 2 184#define NCSI_CHANNEL_INVISIBLE 3 185 bool reconfigure_needed; --- 29 unchanged lines hidden (view full) --- 215 struct list_head node; /* Form list of packages */ 216}; 217 218struct ncsi_request { 219 unsigned char id; /* Request ID - 0 to 255 */ 220 bool used; /* Request that has been assigned */ 221 unsigned int flags; /* NCSI request property */ 222#define NCSI_REQ_FLAG_EVENT_DRIVEN 1 | 180 181struct ncsi_channel { 182 unsigned char id; 183 int state; 184#define NCSI_CHANNEL_INACTIVE 1 185#define NCSI_CHANNEL_ACTIVE 2 186#define NCSI_CHANNEL_INVISIBLE 3 187 bool reconfigure_needed; --- 29 unchanged lines hidden (view full) --- 217 struct list_head node; /* Form list of packages */ 218}; 219 220struct ncsi_request { 221 unsigned char id; /* Request ID - 0 to 255 */ 222 bool used; /* Request that has been assigned */ 223 unsigned int flags; /* NCSI request property */ 224#define NCSI_REQ_FLAG_EVENT_DRIVEN 1 |
225#define NCSI_REQ_FLAG_NETLINK_DRIVEN 2 |
|
223 struct ncsi_dev_priv *ndp; /* Associated NCSI device */ 224 struct sk_buff *cmd; /* Associated NCSI command packet */ 225 struct sk_buff *rsp; /* Associated NCSI response packet */ 226 struct timer_list timer; /* Timer on waiting for response */ 227 bool enabled; /* Time has been enabled or not */ | 226 struct ncsi_dev_priv *ndp; /* Associated NCSI device */ 227 struct sk_buff *cmd; /* Associated NCSI command packet */ 228 struct sk_buff *rsp; /* Associated NCSI response packet */ 229 struct timer_list timer; /* Timer on waiting for response */ 230 bool enabled; /* Time has been enabled or not */ |
231 u32 snd_seq; /* netlink sending sequence number */ 232 u32 snd_portid; /* netlink portid of sender */ 233 struct nlmsghdr nlhdr; /* netlink message header */ |
|
228}; 229 230enum { 231 ncsi_dev_state_major = 0xff00, 232 ncsi_dev_state_minor = 0x00ff, 233 ncsi_dev_state_probe_deselect = 0x0201, 234 ncsi_dev_state_probe_package, 235 ncsi_dev_state_probe_channel, --- 69 unchanged lines hidden (view full) --- 305 unsigned short payload; /* Command packet payload length */ 306 unsigned int req_flags; /* NCSI request properties */ 307 union { 308 unsigned char bytes[16]; /* Command packet specific data */ 309 unsigned short words[8]; 310 unsigned int dwords[4]; 311 }; 312 unsigned char *data; /* NCSI OEM data */ | 234}; 235 236enum { 237 ncsi_dev_state_major = 0xff00, 238 ncsi_dev_state_minor = 0x00ff, 239 ncsi_dev_state_probe_deselect = 0x0201, 240 ncsi_dev_state_probe_package, 241 ncsi_dev_state_probe_channel, --- 69 unchanged lines hidden (view full) --- 311 unsigned short payload; /* Command packet payload length */ 312 unsigned int req_flags; /* NCSI request properties */ 313 union { 314 unsigned char bytes[16]; /* Command packet specific data */ 315 unsigned short words[8]; 316 unsigned int dwords[4]; 317 }; 318 unsigned char *data; /* NCSI OEM data */ |
319 struct genl_info *info; /* Netlink information */ |
|
313}; 314 315extern struct list_head ncsi_dev_list; 316extern spinlock_t ncsi_dev_lock; 317 318#define TO_NCSI_DEV_PRIV(nd) \ 319 container_of(nd, struct ncsi_dev_priv, ndev) 320#define NCSI_FOR_EACH_DEV(ndp) \ --- 36 unchanged lines hidden --- | 320}; 321 322extern struct list_head ncsi_dev_list; 323extern spinlock_t ncsi_dev_lock; 324 325#define TO_NCSI_DEV_PRIV(nd) \ 326 container_of(nd, struct ncsi_dev_priv, ndev) 327#define NCSI_FOR_EACH_DEV(ndp) \ --- 36 unchanged lines hidden --- |