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
51814232
Commit
51814232
authored
Feb 01, 2011
by
Matthew Wilcox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NVMe: Read the model, serial & firmware rev from the controller
Signed-off-by:
Matthew Wilcox
<
matthew.r.wilcox@intel.com
>
parent
a53295b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
drivers/block/nvme.c
drivers/block/nvme.c
+9
-1
No files found.
drivers/block/nvme.c
View file @
51814232
...
...
@@ -58,6 +58,9 @@ struct nvme_dev {
struct
msix_entry
*
entry
;
struct
nvme_bar
__iomem
*
bar
;
struct
list_head
namespaces
;
char
serial
[
20
];
char
model
[
40
];
char
firmware_rev
[
8
];
};
/*
...
...
@@ -979,6 +982,7 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
{
int
res
,
nn
,
i
;
struct
nvme_ns
*
ns
,
*
next
;
struct
nvme_id_ctrl
*
ctrl
;
void
*
id
;
dma_addr_t
dma_addr
;
struct
nvme_command
cid
,
crt
;
...
...
@@ -1003,7 +1007,11 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
goto
out_free
;
}
nn
=
le32_to_cpup
(
&
((
struct
nvme_id_ctrl
*
)
id
)
->
nn
);
ctrl
=
id
;
nn
=
le32_to_cpup
(
&
ctrl
->
nn
);
memcpy
(
dev
->
serial
,
ctrl
->
sn
,
sizeof
(
ctrl
->
sn
));
memcpy
(
dev
->
model
,
ctrl
->
mn
,
sizeof
(
ctrl
->
mn
));
memcpy
(
dev
->
firmware_rev
,
ctrl
->
fr
,
sizeof
(
ctrl
->
fr
));
cid
.
identify
.
cns
=
0
;
memset
(
&
crt
,
0
,
sizeof
(
crt
));
...
...
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