git: ed65c80a3475 - main - Mana: report OS info to PF driver
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 10 Jan 2022 13:34:00 UTC
The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=ed65c80a3475a70f056bb950fba2821f4142ea84 commit ed65c80a3475a70f056bb950fba2821f4142ea84 Author: Wei Hu <whu@FreeBSD.org> AuthorDate: 2022-01-07 13:12:31 +0000 Commit: Wei Hu <whu@FreeBSD.org> CommitDate: 2022-01-10 13:32:30 +0000 Mana: report OS info to PF driver The PF driver might use the OS info for statistical purposes. MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/mana/gdma_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 211e47368cc5..49af54f4be5d 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -1060,6 +1060,9 @@ mana_gd_destroy_queue(struct gdma_context *gc, struct gdma_queue *queue) free(queue, M_DEVBUF); } +#define OS_MAJOR_DIV 100000 +#define OS_BUILD_MOD 1000 + int mana_gd_verify_vf_version(device_t dev) { @@ -1074,6 +1077,14 @@ mana_gd_verify_vf_version(device_t dev) req.protocol_ver_min = GDMA_PROTOCOL_FIRST; req.protocol_ver_max = GDMA_PROTOCOL_LAST; + req.drv_ver = 0; /* Unused */ + req.os_type = 0x30; /* Other */ + req.os_ver_major = osreldate / OS_MAJOR_DIV; + req.os_ver_minor = (osreldate % OS_MAJOR_DIV) / OS_BUILD_MOD; + req.os_ver_build = osreldate % OS_BUILD_MOD; + strncpy(req.os_ver_str1, ostype, sizeof(req.os_ver_str1) - 1); + strncpy(req.os_ver_str2, osrelease, sizeof(req.os_ver_str2) - 1); + err = mana_gd_send_request(gc, sizeof(req), &req, sizeof(resp), &resp); if (err || resp.hdr.status) { device_printf(gc->dev,