xref: /onnv-gate/usr/src/uts/common/sys/ib/clients/rdsv3/info.h (revision 12763:4b30642bc04e)
112198SEiji.Ota@Sun.COM /*
2*12763SGiri.Adari@Sun.COM  * This file contains definitions imported from the OFED rds header info.h.
3*12763SGiri.Adari@Sun.COM  * Oracle elects to have and use the contents of info.h under and
4*12763SGiri.Adari@Sun.COM  * governed by the OpenIB.org BSD license.
512198SEiji.Ota@Sun.COM  */
6*12763SGiri.Adari@Sun.COM 
712198SEiji.Ota@Sun.COM /*
812198SEiji.Ota@Sun.COM  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
912198SEiji.Ota@Sun.COM  */
1012198SEiji.Ota@Sun.COM 
1112198SEiji.Ota@Sun.COM #ifndef _RDSV3_INFO_H
1212198SEiji.Ota@Sun.COM #define	_RDSV3_INFO_H
1312198SEiji.Ota@Sun.COM 
1412198SEiji.Ota@Sun.COM struct rdsv3_info_iterator {
1512198SEiji.Ota@Sun.COM 	char *addr;
1612198SEiji.Ota@Sun.COM 	unsigned long offset;
1712198SEiji.Ota@Sun.COM };
1812198SEiji.Ota@Sun.COM 
1912198SEiji.Ota@Sun.COM struct rdsv3_info_lengths {
2012198SEiji.Ota@Sun.COM 	unsigned int	nr;
2112198SEiji.Ota@Sun.COM 	unsigned int	each;
2212198SEiji.Ota@Sun.COM };
2312198SEiji.Ota@Sun.COM 
2412198SEiji.Ota@Sun.COM struct rdsv3_sock;
2512198SEiji.Ota@Sun.COM 
2612198SEiji.Ota@Sun.COM /*
2712198SEiji.Ota@Sun.COM  * These functions must fill in the fields of @lens to reflect the size
2812198SEiji.Ota@Sun.COM  * of the available info source.  If the snapshot fits in @len then it
2912198SEiji.Ota@Sun.COM  * should be copied using @iter.  The caller will deduce if it was copied
3012198SEiji.Ota@Sun.COM  * or not by comparing the lengths.
3112198SEiji.Ota@Sun.COM  */
3212198SEiji.Ota@Sun.COM typedef void (*rdsv3_info_func)(struct rsock *sock, unsigned int len,
3312198SEiji.Ota@Sun.COM     struct rdsv3_info_iterator *iter,
3412198SEiji.Ota@Sun.COM     struct rdsv3_info_lengths *lens);
3512198SEiji.Ota@Sun.COM 
3612198SEiji.Ota@Sun.COM #define	rdsv3_info_copy(iter, data, bytes)			\
3712580SGiri.Adari@Sun.COM 	(void) ddi_copyout(data, iter->addr + iter->offset, bytes, 0);	\
3812198SEiji.Ota@Sun.COM 	iter->offset += bytes
3912198SEiji.Ota@Sun.COM 
4012198SEiji.Ota@Sun.COM void rdsv3_info_register_func(int optname, rdsv3_info_func func);
4112198SEiji.Ota@Sun.COM void rdsv3_info_deregister_func(int optname, rdsv3_info_func func);
4212580SGiri.Adari@Sun.COM int rdsv3_info_ioctl(struct rsock *sock, int optname, char *optval,
4312580SGiri.Adari@Sun.COM     int32_t *rvalp);
4412198SEiji.Ota@Sun.COM 
4512198SEiji.Ota@Sun.COM #endif /* _RDSV3_INFO_H */
46