* Setup connection between PMD and kernel. */
| 1080 | * Setup connection between PMD and kernel. |
| 1081 | */ |
| 1082 | static int |
| 1083 | hn_attach(struct hn_data *hv, unsigned int mtu) |
| 1084 | { |
| 1085 | int error; |
| 1086 | |
| 1087 | /* Attach NVS */ |
| 1088 | error = hn_nvs_attach(hv, mtu); |
| 1089 | if (error) |
| 1090 | goto failed_nvs; |
| 1091 | |
| 1092 | /* Attach RNDIS */ |
| 1093 | error = hn_rndis_attach(hv); |
| 1094 | if (error) |
| 1095 | goto failed_rndis; |
| 1096 | |
| 1097 | /* |
| 1098 | * NOTE: |
| 1099 | * Under certain conditions on certain versions of Hyper-V, |
| 1100 | * the RNDIS rxfilter is _not_ zero on the hypervisor side |
| 1101 | * after the successful RNDIS initialization. |
| 1102 | */ |
| 1103 | hn_rndis_set_rxfilter(hv, NDIS_PACKET_TYPE_NONE); |
| 1104 | return 0; |
| 1105 | failed_rndis: |
| 1106 | hn_nvs_detach(hv); |
| 1107 | failed_nvs: |
| 1108 | return error; |
| 1109 | } |
| 1110 | |
| 1111 | static void |
| 1112 | hn_detach(struct hn_data *hv) |
no test coverage detected