diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-07-18 21:54:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-19 23:49:16 -0400 |
commit | 6389eaa7fa9c3ee6c7d39f6087b86660d17236ac (patch) | |
tree | 5c915baea8427248f016c7c4630852ee37e3f538 /net/ncsi/internal.h | |
parent | 2d283bdd079c0ad4da020bbc9e9c2a4280823098 (diff) |
net/ncsi: NCSI command packet handler
The NCSI command packets are sent from MC (Management Controller)
to remote end. They are used for multiple purposes: probe existing
NCSI package/channel, retrieve NCSI channel's capability, configure
NCSI channel etc.
This defines struct to represent NCSI command packets and introduces
function ncsi_xmit_cmd(), which will be used to transmit NCSI command
packet according to the request. The request is represented by struct
ncsi_cmd_arg.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi/internal.h')
-rw-r--r-- | net/ncsi/internal.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 89028e1f83cd..3d81697a97d0 100644 --- a/net/ncsi/internal.h +++ b/net/ncsi/internal.h | |||
@@ -220,6 +220,21 @@ struct ncsi_dev_priv { | |||
220 | struct list_head node; /* Form NCSI device list */ | 220 | struct list_head node; /* Form NCSI device list */ |
221 | }; | 221 | }; |
222 | 222 | ||
223 | struct ncsi_cmd_arg { | ||
224 | struct ncsi_dev_priv *ndp; /* Associated NCSI device */ | ||
225 | unsigned char type; /* Command in the NCSI packet */ | ||
226 | unsigned char id; /* Request ID (sequence number) */ | ||
227 | unsigned char package; /* Destination package ID */ | ||
228 | unsigned char channel; /* Detination channel ID or 0x1f */ | ||
229 | unsigned short payload; /* Command packet payload length */ | ||
230 | bool driven; /* Drive the state machine? */ | ||
231 | union { | ||
232 | unsigned char bytes[16]; /* Command packet specific data */ | ||
233 | unsigned short words[8]; | ||
234 | unsigned int dwords[4]; | ||
235 | }; | ||
236 | }; | ||
237 | |||
223 | extern struct list_head ncsi_dev_list; | 238 | extern struct list_head ncsi_dev_list; |
224 | extern spinlock_t ncsi_dev_lock; | 239 | extern spinlock_t ncsi_dev_lock; |
225 | 240 | ||
@@ -253,4 +268,8 @@ struct ncsi_request *ncsi_alloc_request(struct ncsi_dev_priv *ndp, bool driven); | |||
253 | void ncsi_free_request(struct ncsi_request *nr); | 268 | void ncsi_free_request(struct ncsi_request *nr); |
254 | struct ncsi_dev *ncsi_find_dev(struct net_device *dev); | 269 | struct ncsi_dev *ncsi_find_dev(struct net_device *dev); |
255 | 270 | ||
271 | /* Packet handlers */ | ||
272 | u32 ncsi_calculate_checksum(unsigned char *data, int len); | ||
273 | int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca); | ||
274 | |||
256 | #endif /* __NCSI_INTERNAL_H__ */ | 275 | #endif /* __NCSI_INTERNAL_H__ */ |