Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
67408494
Commit
67408494
authored
May 25, 2003
by
Martin Schwidefsky
Committed by
Linus Torvalds
May 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] s390: module alias support.
Add module alias support for ccw devices.
parent
0b1a47c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
28 deletions
+44
-28
include/asm-s390/ccwdev.h
include/asm-s390/ccwdev.h
+1
-28
include/linux/mod_devicetable.h
include/linux/mod_devicetable.h
+18
-0
scripts/file2alias.c
scripts/file2alias.c
+25
-0
No files found.
include/asm-s390/ccwdev.h
View file @
67408494
...
@@ -11,39 +11,12 @@
...
@@ -11,39 +11,12 @@
#define _S390_CCWDEV_H_
#define _S390_CCWDEV_H_
#include <linux/device.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
/* structs from asm/cio.h */
/* structs from asm/cio.h */
struct
irb
;
struct
irb
;
struct
ccw1
;
struct
ccw1
;
/* the id is used to identify what hardware a device driver supports. It
* is used both by the ccw subsystem driver for probing and from
* user space for automatic module loading.
*
* References:
* - struct usb_device_id (include/linux/usb.h)
* - devreg_hc_t (include/linux/s390dyn.h)
* - chandev_model_info (drivers/s390/misc/chandev.c)
*/
struct
ccw_device_id
{
__u16
match_flags
;
/* which fields to match against */
__u16
cu_type
;
/* control unit type */
__u16
dev_type
;
/* device type */
__u8
cu_model
;
/* control unit model */
__u8
dev_model
;
/* device model */
unsigned
long
driver_info
;
};
enum
match_flag
{
CCW_DEVICE_ID_MATCH_CU_TYPE
=
0x01
,
CCW_DEVICE_ID_MATCH_CU_MODEL
=
0x02
,
CCW_DEVICE_ID_MATCH_DEVICE_TYPE
=
0x04
,
CCW_DEVICE_ID_MATCH_DEVICE_MODEL
=
0x08
,
/* CCW_DEVICE_ID_MATCH_ANY = 0x10, */
};
/* simplified initializers for struct ccw_device:
/* simplified initializers for struct ccw_device:
* CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
* CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
* entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */
* entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */
...
...
include/linux/mod_devicetable.h
View file @
67408494
...
@@ -130,4 +130,22 @@ struct usb_device_id {
...
@@ -130,4 +130,22 @@ struct usb_device_id {
#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
/* s390 CCW devices */
struct
ccw_device_id
{
__u16
match_flags
;
/* which fields to match against */
__u16
cu_type
;
/* control unit type */
__u16
dev_type
;
/* device type */
__u8
cu_model
;
/* control unit model */
__u8
dev_model
;
/* device model */
kernel_ulong_t
driver_info
;
};
#define CCW_DEVICE_ID_MATCH_CU_TYPE 0x01
#define CCW_DEVICE_ID_MATCH_CU_MODEL 0x02
#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04
#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08
#endif
/* LINUX_MOD_DEVICETABLE_H */
#endif
/* LINUX_MOD_DEVICETABLE_H */
scripts/file2alias.c
View file @
67408494
...
@@ -147,6 +147,28 @@ static int do_pci_entry(const char *filename,
...
@@ -147,6 +147,28 @@ static int do_pci_entry(const char *filename,
return
1
;
return
1
;
}
}
/* looks like: "ccw:tNmNdtNdmN" */
static
int
do_ccw_entry
(
const
char
*
filename
,
struct
ccw_device_id
*
id
,
char
*
alias
)
{
id
->
match_flags
=
TO_NATIVE
(
id
->
match_flags
);
id
->
cu_type
=
TO_NATIVE
(
id
->
cu_type
);
id
->
cu_model
=
TO_NATIVE
(
id
->
cu_model
);
id
->
dev_type
=
TO_NATIVE
(
id
->
dev_type
);
id
->
dev_model
=
TO_NATIVE
(
id
->
dev_model
);
strcpy
(
alias
,
"ccw:"
);
ADD
(
alias
,
"t"
,
id
->
match_flags
&
CCW_DEVICE_ID_MATCH_CU_TYPE
,
id
->
cu_type
);
ADD
(
alias
,
"m"
,
id
->
match_flags
&
CCW_DEVICE_ID_MATCH_CU_MODEL
,
id
->
cu_model
);
ADD
(
alias
,
"dt"
,
id
->
match_flags
&
CCW_DEVICE_ID_MATCH_DEVICE_TYPE
,
id
->
dev_type
);
ADD
(
alias
,
"dm"
,
id
->
match_flags
&
CCW_DEVICE_ID_MATCH_DEVICE_TYPE
,
id
->
dev_model
);
return
1
;
}
/* Ignore any prefix, eg. v850 prepends _ */
/* Ignore any prefix, eg. v850 prepends _ */
static
inline
int
sym_is
(
const
char
*
symbol
,
const
char
*
name
)
static
inline
int
sym_is
(
const
char
*
symbol
,
const
char
*
name
)
{
{
...
@@ -210,6 +232,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
...
@@ -210,6 +232,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
else
if
(
sym_is
(
symname
,
"__mod_ieee1394_device_table"
))
else
if
(
sym_is
(
symname
,
"__mod_ieee1394_device_table"
))
do_table
(
symval
,
sym
->
st_size
,
sizeof
(
struct
ieee1394_device_id
),
do_table
(
symval
,
sym
->
st_size
,
sizeof
(
struct
ieee1394_device_id
),
do_ieee1394_entry
,
mod
);
do_ieee1394_entry
,
mod
);
else
if
(
sym_is
(
symname
,
"__mod_ccw_device_table"
))
do_table
(
symval
,
sym
->
st_size
,
sizeof
(
struct
ccw_device_id
),
do_ccw_entry
,
mod
);
}
}
/* Now add out buffered information to the generated C source */
/* Now add out buffered information to the generated C source */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment