40 #define EPROTO_OPEN __einfo_error ( EINFO_EPROTO_OPEN ) 41 #define EINFO_EPROTO_OPEN \ 42 __einfo_uniqify ( EINFO_EPROTO, 0x00, "GuestRPC open failed" ) 43 #define EPROTO_COMMAND_LEN __einfo_error ( EINFO_EPROTO_COMMAND_LEN ) 44 #define EINFO_EPROTO_COMMAND_LEN \ 45 __einfo_uniqify ( EINFO_EPROTO, 0x01, "GuestRPC command length failed" ) 46 #define EPROTO_COMMAND_DATA __einfo_error ( EINFO_EPROTO_COMMAND_DATA ) 47 #define EINFO_EPROTO_COMMAND_DATA \ 48 __einfo_uniqify ( EINFO_EPROTO, 0x02, "GuestRPC command data failed" ) 49 #define EPROTO_REPLY_LEN __einfo_error ( EINFO_EPROTO_REPLY_LEN ) 50 #define EINFO_EPROTO_REPLY_LEN \ 51 __einfo_uniqify ( EINFO_EPROTO, 0x03, "GuestRPC reply length failed" ) 52 #define EPROTO_REPLY_DATA __einfo_error ( EINFO_EPROTO_REPLY_DATA ) 53 #define EINFO_EPROTO_REPLY_DATA \ 54 __einfo_uniqify ( EINFO_EPROTO, 0x04, "GuestRPC reply data failed" ) 55 #define EPROTO_REPLY_FINISH __einfo_error ( EINFO_EPROTO_REPLY_FINISH ) 56 #define EINFO_EPROTO_REPLY_FINISH \ 57 __einfo_uniqify ( EINFO_EPROTO, 0x05, "GuestRPC reply finish failed" ) 58 #define EPROTO_CLOSE __einfo_error ( EINFO_EPROTO_CLOSE ) 59 #define EINFO_EPROTO_CLOSE \ 60 __einfo_uniqify ( EINFO_EPROTO, 0x06, "GuestRPC close failed" ) 99 &discard_d, &discard_b );
102 "length %zd failed: status %08x\n",
124 &discard_d, &discard_b );
127 "data %08x failed: status %08x\n",
176 "%d data failed: status %08x\n",
198 &discard_d, &discard_b );
220 &discard_d, &discard_b );
245 uint8_t *reply_bytes = ( (
void * ) reply );
247 int orig_reply_len = reply_len;
250 size_t status_len =
sizeof (
status );
263 assert ( ( reply !=
NULL ) || ( reply_len == 0 ) );
272 for ( i =
sizeof (
data ) ; i ; i-- ) {
275 *(command_bytes++) );
291 for ( remaining =
len ; remaining > 0 ; remaining -=
sizeof (
data ) ) {
296 for ( i =
sizeof (
data ) ; i ; i-- ) {
298 *(status_bytes++) = (
data & 0xff );
301 }
else if ( reply_len ) {
302 *(reply_bytes++) = (
data & 0xff );
317 ( (
len < orig_reply_len ) ?
len : orig_reply_len ) );
322 "(status %04x, reply id %d, reply length %d):\n",
327 ( (
len < orig_reply_len ) ?
len : orig_reply_len ));
struct arbelprm_rc_send_wqe rc
#define GUESTRPC_OPEN_SUCCESS
Open RPC channel success status.
static int guestrpc_reply_data(int channel, uint16_t reply_id, uint32_t *data)
Receive GuestRPC reply data.
#define GUESTRPC_COMMAND_LEN_SUCCESS
Send RPC command length success status.
int guestrpc_open(void)
Open GuestRPC channel.
#define GUESTRPC_CLOSE
Close RPC channel.
static int guestrpc_command_data(int channel, uint32_t data)
Send GuestRPC command data.
#define EPROTO_REPLY_FINISH
#define GUESTRPC_COMMAND_DATA_SUCCESS
Send RPC command data success status.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define GUESTRPC_CLOSE_SUCCESS
Close RPC channel success status.
#define GUESTRPC_REPLY_DATA
Receive RPC reply data.
#define GUESTRPC_REPLY_DATA_SUCCESS
Receive RPC reply data success status.
#define EPROTO_REPLY_DATA
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
VMware backdoor mechanism.
#define GUESTRPC_COMMAND_DATA
Send RPC command data.
static int guestrpc_command_len(int channel, size_t len)
Send GuestRPC command length.
VMware GuestRPC mechanism.
uint32_t channel
RNDIS channel.
int guestrpc_command(int channel, const char *command, char *reply, size_t reply_len)
Issue GuestRPC command.
static int guestrpc_reply_len(int channel, uint16_t *reply_id)
Receive GuestRPC reply length.
#define GUESTRPC_COMMAND_LEN
Send RPC command length.
#define EPROTO_COMMAND_LEN
void guestrpc_close(int channel)
Close GuestRPC channel.
size_t strlen(const char *src)
Get length of string.
#define GUESTRPC_REPLY_LEN_SUCCESS
Receive RPC reply length success status.
#define GUESTRPC_OPEN
Open RPC channel.
#define EPROTO_COMMAND_DATA
static int guestrpc_reply_finish(int channel, uint16_t reply_id)
Finish receiving GuestRPC reply.
#define GUESTRPC_SUCCESS
RPC command success status.
#define EIO
Input/output error.
uint8_t data[48]
Additional event data.
#define GUESTRPC_REPLY_FINISH_SUCCESS
Finish receiving RPC reply success status.
#define GUESTRPC_REPLY_FINISH
Finish receiving RPC reply.
#define GUESTRPC_REPLY_LEN
Receive RPC reply length.
#define GUESTRPC_MAGIC
GuestRPC magic number.
#define NULL
NULL pointer (VOID *)