Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hv_rndis_filter.c
Show First 20 Lines • Show All 922 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* RNDIS filter halt device | * RNDIS filter halt device | ||||
*/ | */ | ||||
static int | static int | ||||
hv_rf_halt_device(rndis_device *device) | hv_rf_halt_device(rndis_device *device) | ||||
{ | { | ||||
rndis_request *request; | rndis_request *request; | ||||
rndis_halt_request *halt; | |||||
int i, ret; | int i, ret; | ||||
/* Attempt to do a rndis device halt */ | /* Attempt to do a rndis device halt */ | ||||
request = hv_rndis_request(device, REMOTE_NDIS_HALT_MSG, | request = hv_rndis_request(device, REMOTE_NDIS_HALT_MSG, | ||||
RNDIS_MESSAGE_SIZE(rndis_halt_request)); | RNDIS_MESSAGE_SIZE(rndis_halt_request)); | ||||
if (request == NULL) { | if (request == NULL) { | ||||
return (-1); | return (-1); | ||||
} | } | ||||
/* initialize "poor man's semaphore" */ | /* initialize "poor man's semaphore" */ | ||||
request->halt_complete_flag = 0; | request->halt_complete_flag = 0; | ||||
/* Set up the rndis set */ | |||||
halt = &request->request_msg.msg.halt_request; | |||||
halt->request_id = atomic_fetchadd_int(&device->new_request_id, 1); | |||||
/* Increment to get the new value (call above returns old value) */ | |||||
halt->request_id += 1; | |||||
ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG); | ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG); | ||||
if (ret != 0) { | if (ret != 0) { | ||||
return (-1); | return (-1); | ||||
} | } | ||||
/* | /* | ||||
* Wait for halt response from halt callback. We must wait for | * Wait for halt response from halt callback. We must wait for | ||||
* the transaction response before freeing the request and other | * the transaction response before freeing the request and other | ||||
▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines |