Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / unisys / include / vbushelper.h
1 /* vbushelper.h
2  *
3  * Copyright (C) 2011 - 2013 UNISYS CORPORATION
4  * All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or (at
9  * your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14  * NON INFRINGEMENT.  See the GNU General Public License for more
15  * details.
16  */
17
18 #ifndef __VBUSHELPER_H__
19 #define __VBUSHELPER_H__
20
21 #include "vbusdeviceinfo.h"
22
23 /* TARGET_HOSTNAME specified as -DTARGET_HOSTNAME=\"thename\" on the
24  * command line */
25
26 #define TARGET_HOSTNAME "linuxguest"
27
28 static inline void bus_device_info_init(
29                 struct ultra_vbus_deviceinfo *bus_device_info_ptr,
30                 const char *dev_type, const char *drv_name,
31                 const char *ver, const char *ver_tag)
32 {
33         memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
34         snprintf(bus_device_info_ptr->devtype,
35                  sizeof(bus_device_info_ptr->devtype),
36                  "%s", (dev_type) ? dev_type : "unknownType");
37         snprintf(bus_device_info_ptr->drvname,
38                  sizeof(bus_device_info_ptr->drvname),
39                  "%s", (drv_name) ? drv_name : "unknownDriver");
40         snprintf(bus_device_info_ptr->infostrs,
41                  sizeof(bus_device_info_ptr->infostrs), "%s\t%s\t%s",
42                  (ver) ? ver : "unknownVer",
43                  (ver_tag) ? ver_tag : "unknownVerTag",
44                  TARGET_HOSTNAME);
45 }
46
47 #endif