http://git.etherboot.org
/
mirror
/
winof
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mthca] Fix a build break. [mlnx: 4411]
[mirror/winof/.git]
/
hw
/
mthca
/
kernel
/
mt_device.c
diff --git
a/hw/mthca/kernel/mt_device.c
b/hw/mthca/kernel/mt_device.c
index
a8d4d0c
..
883c986
100644
(file)
--- a/
hw/mthca/kernel/mt_device.c
+++ b/
hw/mthca/kernel/mt_device.c
@@
-30,7
+30,7
@@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
- * $Id
: device.c 2730 2005-06-28 16:43:03Z sean.hefty
$
+ * $Id$
*/
#include "hca_driver.h"
*/
#include "hca_driver.h"
@@
-70,8
+70,8
@@
static int ib_device_check_mandatory(struct ib_device *device)
} mandatory_table[] = {
IB_MANDATORY_FUNC(query_device),
IB_MANDATORY_FUNC(query_port),
} mandatory_table[] = {
IB_MANDATORY_FUNC(query_device),
IB_MANDATORY_FUNC(query_port),
- IB_MANDATORY_FUNC(query_pkey),
- IB_MANDATORY_FUNC(query_gid),
+ IB_MANDATORY_FUNC(query_pkey
_chunk
),
+ IB_MANDATORY_FUNC(query_gid
_chunk
),
IB_MANDATORY_FUNC(alloc_pd),
IB_MANDATORY_FUNC(dealloc_pd),
IB_MANDATORY_FUNC(create_ah),
IB_MANDATORY_FUNC(alloc_pd),
IB_MANDATORY_FUNC(dealloc_pd),
IB_MANDATORY_FUNC(create_ah),
@@
-140,14
+140,18
@@
static int alloc_name(char *name)
continue;
if (i < 0 || i >= PAGE_SIZE * 8)
continue;
continue;
if (i < 0 || i >= PAGE_SIZE * 8)
continue;
- snprintf(buf, sizeof buf, name, i);
+ if (RtlStringCbPrintfA(buf, sizeof buf, name, i))
+ return -EINVAL;
+
if (!strncmp(buf, device->name, IB_DEVICE_NAME_MAX))
set_bit(i, inuse);
}
i = find_first_zero_bit((const unsigned long *)inuse, PAGE_SIZE * 8);
free_page(inuse);
if (!strncmp(buf, device->name, IB_DEVICE_NAME_MAX))
set_bit(i, inuse);
}
i = find_first_zero_bit((const unsigned long *)inuse, PAGE_SIZE * 8);
free_page(inuse);
- snprintf(buf, sizeof buf, name, i);
+ if (RtlStringCbPrintfA(buf, sizeof buf, name, i))
+ return -EINVAL;
+
if (__ib_device_get_by_name(buf))
return -ENFILE;
if (__ib_device_get_by_name(buf))
return -ENFILE;
@@
-472,34
+476,34
@@
int ib_query_port(struct ib_device *device,
/**
/**
- * ib_query_gid
- Get GID table entry
+ * ib_query_gid
_chunk - Get a chunk of GID table entries
* @device:Device to query
* @port_num:Port number to query
* @index:GID table index to query
* @device:Device to query
* @port_num:Port number to query
* @index:GID table index to query
- * @gid:Returned GID
+ * @gid:Returned GID
s chunk
*
*
- * ib_query_gid
() fetches the specified GID table entry
.
+ * ib_query_gid
_chunk() fetches the specified GID table enties chunk
.
*/
*/
-int ib_query_gid(struct ib_device *device,
- u8 port_num, int index, union ib_gid
*gid
)
+int ib_query_gid
_chunk
(struct ib_device *device,
+ u8 port_num, int index, union ib_gid
gid[8]
)
{
{
- return device->query_gid(device, port_num, index, gid);
+ return device->query_gid
_chunk
(device, port_num, index, gid);
}
/**
}
/**
- * ib_query_pkey
- Get P_Key table entry
+ * ib_query_pkey
_chunk - Get a chunk of P_Key table entries
* @device:Device to query
* @port_num:Port number to query
* @index:P_Key table index to query
* @device:Device to query
* @port_num:Port number to query
* @index:P_Key table index to query
- * @pkey:Returned P_Key
+ * @pkey:Returned P_Key
s chunk
*
*
- * ib_query_pkey
() fetches the specified P_Key table entry
.
+ * ib_query_pkey
_chunk() fetches the specified P_Key table entries chunk
.
*/
*/
-int ib_query_pkey(struct ib_device *device,
- u8 port_num, u16 index,
u16 *pkey
)
+int ib_query_pkey
_chunk
(struct ib_device *device,
+ u8 port_num, u16 index,
__be16 pkey[32]
)
{
{
- return device->query_pkey(device, port_num, index, pkey);
+ return device->query_pkey
_chunk
(device, port_num, index, pkey);
}
}