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
nexedi
linux
Commits
468066f7
Commit
468066f7
authored
Jul 22, 2010
by
Stefan Richter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/firewire: nosy-dump: make some symbols static or const
Signed-off-by:
Stefan Richter
<
stefanr@s5r6.in-berlin.de
>
parent
92c16f7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
tools/firewire/nosy-dump.c
tools/firewire/nosy-dump.c
+29
-27
No files found.
tools/firewire/nosy-dump.c
View file @
468066f7
...
...
@@ -133,7 +133,7 @@ static const struct poptOption options[] = {
};
/* Allow all ^C except the first to interrupt the program in the usual way. */
void
static
void
sigint_handler
(
int
signal_num
)
{
if
(
run
==
1
)
{
...
...
@@ -142,7 +142,7 @@ sigint_handler(int signal_num)
}
}
struct
subaction
*
st
atic
st
ruct
subaction
*
subaction_create
(
uint32_t
*
data
,
size_t
length
)
{
struct
subaction
*
sa
;
...
...
@@ -156,17 +156,17 @@ subaction_create(uint32_t *data, size_t length)
return
sa
;
}
void
static
void
subaction_destroy
(
struct
subaction
*
sa
)
{
free
(
sa
);
}
struct
list
pending_transaction_list
=
{
st
atic
st
ruct
list
pending_transaction_list
=
{
&
pending_transaction_list
,
&
pending_transaction_list
};
struct
link_transaction
*
st
atic
st
ruct
link_transaction
*
link_transaction_lookup
(
int
request_node
,
int
response_node
,
int
tlabel
)
{
struct
link_transaction
*
t
;
...
...
@@ -190,7 +190,7 @@ link_transaction_lookup(int request_node, int response_node, int tlabel)
return
t
;
}
void
static
void
link_transaction_destroy
(
struct
link_transaction
*
t
)
{
struct
subaction
*
sa
;
...
...
@@ -213,11 +213,11 @@ struct protocol_decoder {
int
(
*
decode
)(
struct
link_transaction
*
t
);
};
static
struct
protocol_decoder
protocol_decoders
[]
=
{
static
const
struct
protocol_decoder
protocol_decoders
[]
=
{
{
"FCP"
,
decode_fcp
}
};
void
static
void
handle_transaction
(
struct
link_transaction
*
t
)
{
struct
subaction
*
sa
;
...
...
@@ -254,7 +254,7 @@ handle_transaction(struct link_transaction *t)
link_transaction_destroy
(
t
);
}
void
static
void
clear_pending_transaction_list
(
void
)
{
struct
link_transaction
*
t
;
...
...
@@ -313,7 +313,7 @@ struct packet_info {
const
char
*
name
;
int
type
;
int
response_tcode
;
struct
packet_field
*
fields
;
const
struct
packet_field
*
fields
;
int
field_count
;
};
...
...
@@ -344,20 +344,20 @@ struct packet_field {
{ "src", 32, 16 }, \
{ "rcode", 48, 4, PACKET_FIELD_TRANSACTION, rcode_names }
struct
packet_field
read_quadlet_request_fields
[]
=
{
st
atic
const
st
ruct
packet_field
read_quadlet_request_fields
[]
=
{
COMMON_REQUEST_FIELDS
,
{
"crc"
,
96
,
32
,
PACKET_FIELD_DETAIL
},
{
"ack"
,
156
,
4
,
0
,
ack_names
},
};
struct
packet_field
read_quadlet_response_fields
[]
=
{
st
atic
const
st
ruct
packet_field
read_quadlet_response_fields
[]
=
{
COMMON_RESPONSE_FIELDS
,
{
"data"
,
96
,
32
,
PACKET_FIELD_TRANSACTION
},
{
"crc"
,
128
,
32
,
PACKET_FIELD_DETAIL
},
{
"ack"
,
188
,
4
,
0
,
ack_names
},
};
struct
packet_field
read_block_request_fields
[]
=
{
st
atic
const
st
ruct
packet_field
read_block_request_fields
[]
=
{
COMMON_REQUEST_FIELDS
,
{
"data_length"
,
96
,
16
,
PACKET_FIELD_TRANSACTION
},
{
"extended_tcode"
,
112
,
16
},
...
...
@@ -365,7 +365,7 @@ struct packet_field read_block_request_fields[] = {
{
"ack"
,
188
,
4
,
0
,
ack_names
},
};
struct
packet_field
block_response_fields
[]
=
{
st
atic
const
st
ruct
packet_field
block_response_fields
[]
=
{
COMMON_RESPONSE_FIELDS
,
{
"data_length"
,
96
,
16
,
PACKET_FIELD_DATA_LENGTH
},
{
"extended_tcode"
,
112
,
16
},
...
...
@@ -375,13 +375,13 @@ struct packet_field block_response_fields[] = {
{
"ack"
,
-
4
,
4
,
0
,
ack_names
},
};
struct
packet_field
write_quadlet_request_fields
[]
=
{
st
atic
const
st
ruct
packet_field
write_quadlet_request_fields
[]
=
{
COMMON_REQUEST_FIELDS
,
{
"data"
,
96
,
32
,
PACKET_FIELD_TRANSACTION
},
{
"ack"
,
-
4
,
4
,
0
,
ack_names
},
};
struct
packet_field
block_request_fields
[]
=
{
st
atic
const
st
ruct
packet_field
block_request_fields
[]
=
{
COMMON_REQUEST_FIELDS
,
{
"data_length"
,
96
,
16
,
PACKET_FIELD_DATA_LENGTH
|
PACKET_FIELD_TRANSACTION
},
{
"extended_tcode"
,
112
,
16
,
PACKET_FIELD_TRANSACTION
},
...
...
@@ -391,13 +391,13 @@ struct packet_field block_request_fields[] = {
{
"ack"
,
-
4
,
4
,
0
,
ack_names
},
};
struct
packet_field
write_response_fields
[]
=
{
st
atic
const
st
ruct
packet_field
write_response_fields
[]
=
{
COMMON_RESPONSE_FIELDS
,
{
"reserved"
,
64
,
32
,
PACKET_FIELD_DETAIL
},
{
"ack"
,
-
4
,
4
,
0
,
ack_names
},
};
struct
packet_field
iso_data_fields
[]
=
{
st
atic
const
st
ruct
packet_field
iso_data_fields
[]
=
{
{
"data_length"
,
0
,
16
,
PACKET_FIELD_DATA_LENGTH
},
{
"tag"
,
16
,
2
},
{
"channel"
,
18
,
6
},
...
...
@@ -409,7 +409,7 @@ struct packet_field iso_data_fields[] = {
{
"ack"
,
-
4
,
4
,
0
,
ack_names
},
};
static
struct
packet_info
packet_info
[]
=
{
static
const
struct
packet_info
packet_info
[]
=
{
{
.
name
=
"write_quadlet_request"
,
.
type
=
PACKET_REQUEST
,
...
...
@@ -486,7 +486,7 @@ static struct packet_info packet_info[] = {
},
};
int
static
int
handle_packet
(
uint32_t
*
data
,
size_t
length
)
{
if
(
length
==
0
)
{
...
...
@@ -629,7 +629,8 @@ handle_packet(uint32_t *data, size_t length)
return
1
;
}
unsigned
int
get_bits
(
struct
link_packet
*
packet
,
int
offset
,
int
width
)
static
unsigned
int
get_bits
(
struct
link_packet
*
packet
,
int
offset
,
int
width
)
{
uint32_t
*
data
=
(
uint32_t
*
)
packet
;
uint32_t
index
,
shift
,
mask
;
...
...
@@ -649,7 +650,8 @@ unsigned int get_bits(struct link_packet *packet, int offset, int width)
#error unsupported byte order.
#endif
void
dump_data
(
unsigned
char
*
data
,
int
length
)
static
void
dump_data
(
unsigned
char
*
data
,
int
length
)
{
int
i
,
print_length
;
...
...
@@ -671,14 +673,14 @@ static void
decode_link_packet
(
struct
link_packet
*
packet
,
size_t
length
,
int
include_flags
,
int
exclude_flags
)
{
struct
packet_info
*
pi
;
const
struct
packet_info
*
pi
;
int
data_length
=
0
;
int
i
;
pi
=
&
packet_info
[
packet
->
common
.
tcode
];
for
(
i
=
0
;
i
<
pi
->
field_count
;
i
++
)
{
struct
packet_field
*
f
=
&
pi
->
fields
[
i
];
const
struct
packet_field
*
f
=
&
pi
->
fields
[
i
];
int
offset
;
if
(
f
->
flags
&
exclude_flags
)
...
...
@@ -848,15 +850,15 @@ print_stats(uint32_t *data, size_t length)
printf
(
SHOW_CURSOR
"
\n
"
);
}
struct
termios
saved_attributes
;
st
atic
st
ruct
termios
saved_attributes
;
void
static
void
reset_input_mode
(
void
)
{
tcsetattr
(
STDIN_FILENO
,
TCSANOW
,
&
saved_attributes
);
}
void
static
void
set_input_mode
(
void
)
{
struct
termios
tattr
;
...
...
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