Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hn_nvs.c
Show First 20 Lines • Show All 494 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct hn_nvs_ndis_conf conf; | struct hn_nvs_ndis_conf conf; | ||||
int error; | int error; | ||||
memset(&conf, 0, sizeof(conf)); | memset(&conf, 0, sizeof(conf)); | ||||
conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; | conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; | ||||
conf.nvs_mtu = mtu; | conf.nvs_mtu = mtu; | ||||
conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; | conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; | ||||
if (sc->hn_nvs_ver >= HN_NVS_VERSION_5) | |||||
conf.nvs_caps |= HN_NVS_NDIS_CONF_SRIOV; | |||||
/* NOTE: No response. */ | /* NOTE: No response. */ | ||||
error = hn_nvs_req_send(sc, &conf, sizeof(conf)); | error = hn_nvs_req_send(sc, &conf, sizeof(conf)); | ||||
if (error) { | if (error) { | ||||
if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); | if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, | hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, | ||||
struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) | struct hn_nvs_sendctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) | ||||
{ | { | ||||
return hn_nvs_send_rndis_sglist(chan, HN_NVS_RNDIS_MTYPE_CTRL, | return hn_nvs_send_rndis_sglist(chan, HN_NVS_RNDIS_MTYPE_CTRL, | ||||
sndc, gpa, gpa_cnt); | sndc, gpa, gpa_cnt); | ||||
} | |||||
void | |||||
hn_nvs_set_vf(struct hn_softc *sc, bool vf) | |||||
sepherosa_gmail.com: I'd prefer to pass HN_NVS_DATAPATH_* as the second arg. | |||||
{ | |||||
struct hn_nvs_set_datapath dp; | |||||
memset(&dp, 0, sizeof(dp)); | |||||
dp.nvs_type = HN_NVS_TYPE_SET_DATAPATH; | |||||
dp.nvs_active_path = vf ? HN_NVS_DATAPATH_VF : | |||||
HN_NVS_DATAPATH_SYNTHETIC; | |||||
hn_nvs_req_send(sc, &dp, sizeof(dp)); | |||||
} | } |
I'd prefer to pass HN_NVS_DATAPATH_* as the second arg.