Skip to content

Commit a2f897c

Browse files
Merge branch 'master_devel'
2 parents a918b03 + 93a8b0f commit a2f897c

File tree

5 files changed

+627
-778
lines changed

5 files changed

+627
-778
lines changed

kernel/mst.h

Lines changed: 21 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,6 @@
1+
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
12
/*
2-
* Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
3-
*
4-
* This software is available to you under a choice of one of two
5-
* licenses. You may choose to be licensed under the terms of the GNU
6-
* General Public License (GPL) Version 2, available from the file
7-
* COPYING in the main directory of this source tree, or the
8-
* OpenIB.org BSD license below:
9-
*
10-
* Redistribution and use in source and binary forms, with or
11-
* without modification, are permitted provided that the following
12-
* conditions are met:
13-
*
14-
* - Redistributions of source code must retain the above
15-
* copyright notice, this list of conditions and the following
16-
* disclaimer.
17-
*
18-
* - Redistributions in binary form must reproduce the above
19-
* copyright notice, this list of conditions and the following
20-
* disclaimer in the documentation and/or other materials
21-
* provided with the distribution.
22-
*
23-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27-
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28-
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30-
* SOFTWARE.
3+
* Copyright (c) 2018 Mellanox Technologies. All rights reserved.
314
*/
325

336
#ifndef _MST_H_
@@ -61,10 +34,10 @@ struct mst_params {
6134
unsigned int func;
6235
unsigned int bar;
6336
unsigned int device;
64-
unsigned int vendor;
37+
unsigned int vendor;
6538
unsigned int subsystem_device;
66-
unsigned int subsystem_vendor;
67-
unsigned int vendor_specific_cap;
39+
unsigned int subsystem_vendor;
40+
unsigned int vendor_specific_cap;
6841
};
6942

7043
typedef uint32_t u32;
@@ -74,18 +47,18 @@ typedef uint32_t u32;
7447
#define MST_READ4 _IOR(MST_BYTE_ACCESS_MAGIC, 1, struct mst_read4_st)
7548

7649
struct mst_read4_st {
77-
unsigned int address_space;
78-
unsigned int offset;
79-
unsigned int data; /*OUT*/
50+
unsigned int address_space;
51+
unsigned int offset;
52+
unsigned int data; /*OUT*/
8053
};
8154

8255

8356
#define MST_WRITE4 _IOW(MST_BYTE_ACCESS_MAGIC, 2, struct mst_write4_st)
8457

8558
struct mst_write4_st {
86-
unsigned int address_space;
87-
unsigned int offset;
88-
unsigned int data;
59+
unsigned int address_space;
60+
unsigned int offset;
61+
unsigned int data;
8962
};
9063

9164

@@ -115,20 +88,20 @@ struct mst_write_block_st {
11588
};
11689

11790

118-
#define PCICONF_READ4_BUFFER _IOR (MST_BLOCK_ACCESS_MAGIC, 3, struct mst_read4_st)
91+
#define PCICONF_READ4_BUFFER _IOR(MST_BLOCK_ACCESS_MAGIC, 3, struct mst_read4_st)
11992
struct mst_read4_buffer_st {
120-
unsigned int address_space;
121-
unsigned int offset;
122-
int size;
123-
unsigned int data[PCICONF_MAX_BUFFER_SIZE/4]; /*OUT*/
93+
unsigned int address_space;
94+
unsigned int offset;
95+
int size;
96+
unsigned int data[PCICONF_MAX_BUFFER_SIZE/4]; /*OUT*/
12497
};
12598

126-
#define PCICONF_WRITE4_BUFFER _IOW (MST_BLOCK_ACCESS_MAGIC, 4, struct mst_write4_buffer_st)
99+
#define PCICONF_WRITE4_BUFFER _IOW(MST_BLOCK_ACCESS_MAGIC, 4, struct mst_write4_buffer_st)
127100
struct mst_write4_buffer_st {
128-
unsigned int address_space;
129-
unsigned int offset;
130-
int size;
131-
unsigned int data[PCICONF_MAX_BUFFER_SIZE/4]; /*IN*/
101+
unsigned int address_space;
102+
unsigned int offset;
103+
int size;
104+
unsigned int data[PCICONF_MAX_BUFFER_SIZE/4]; /*IN*/
132105
};
133106
/****************************************************/
134107
/*

kernel/mst_kernel.h

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,8 @@
1+
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
12
/*
2-
* Copyright (c) 2011-2014 Mellanox Technologies, Inc. All rights reserved.
3-
*
4-
* This software is available to you under a choice of one of two
5-
* licenses. You may choose to be licensed under the terms of the GNU
6-
* General Public License (GPL) Version 2, available from the file
7-
* COPYING in the main directory of this source tree, or the
8-
* OpenIB.org BSD license below:
9-
*
10-
* Redistribution and use in source and binary forms, with or
11-
* without modification, are permitted provided that the following
12-
* conditions are met:
13-
*
14-
* - Redistributions of source code must retain the above
15-
* copyright notice, this list of conditions and the following
16-
* disclaimer.
17-
*
18-
* - Redistributions in binary form must reproduce the above
19-
* copyright notice, this list of conditions and the following
20-
* disclaimer in the documentation and/or other materials
21-
* provided with the distribution.
22-
*
23-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27-
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28-
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30-
* SOFTWARE.
3+
* Copyright (c) 2018 Mellanox Technologies. All rights reserved.
314
*/
325

33-
346
#ifndef _MST_KERNEL_H_
357
#define _MST_KERNEL_H_
368

@@ -72,9 +44,9 @@
7244
#define MST_VPD_DEFAULT_TOUT 2000 /* milli seconds */
7345

7446
#define mst_err(format, arg...) \
75-
printk(KERN_ERR "%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
47+
pr_err("%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
7648
#define mst_info(format, arg...) \
77-
printk(KERN_INFO "%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
49+
pr_info("%s: %s %d: " format, MST_PREFIX, __func__, __LINE__, ## arg)
7850

7951

8052
/****************************************************/
@@ -87,36 +59,36 @@ enum dev_type {
8759
struct mst_dev_data {
8860
int addr_reg; /* PCICONF address register */
8961
int data_reg; /* PCICONF data register */
90-
int wo_addr;
62+
int wo_addr;
9163
unsigned int bar; /* PCIMEM bar */
9264
void *hw_addr; /* PCIMEM memory start */
9365
char name[MST_NAME_SIZE]; /* name of character device */
9466
enum dev_type type; /* type of device */
95-
struct pci_dev *pci_dev; /* device pci struct in kernel */
67+
struct pci_dev *pci_dev; /* device pci struct in kernel */
9668
struct list_head list; /* list of mst_devices */
9769
struct mutex lock; /* device lock */
9870
int vpd_cap_addr; /* addr VPD capability */
9971
int major; /* device major number */
10072
int initialized; /* indicate if init done */
10173

102-
dev_t my_dev;
103-
struct cdev mcdev;
104-
struct class *cl;
74+
dev_t my_dev;
75+
struct cdev mcdev;
76+
struct class *cl;
10577

10678
unsigned char connectx_wa_slots; /* wa for pci bug */
10779
/* Vendor specific capability address */
108-
int vendor_specific_cap;
80+
int vendor_specific_cap;
10981
/* status on VSEC supported spaces*/
110-
int spaces_support_status;
82+
int spaces_support_status;
11183
};
11284

11385

11486
/****************************************************/
11587
int pci_read4_vpd(struct mst_dev_data *dev, unsigned int timeout,
116-
unsigned offset, u32 *buf);
88+
unsigned int offset, u32 *buf);
11789

11890
int pci_write4_vpd(struct mst_dev_data *dev, unsigned int timeout,
119-
unsigned offset, u32 buf);
91+
unsigned int offset, u32 buf);
12092

12193

12294
#endif /* _MST_KERNEL_H_ */

0 commit comments

Comments
 (0)