Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dataservices-commonsys
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
dataservices-commonsys
Commits
0f57f49c
Commit
0f57f49c
authored
11 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge "rmnetctl: Changes for guaranteed padding"
parents
2bd1a268
22fa3888
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
rmnetctl/cli/rmnetcli.c
+13
-6
13 additions, 6 deletions
rmnetctl/cli/rmnetcli.c
rmnetctl/inc/librmnetctl.h
+36
-8
36 additions, 8 deletions
rmnetctl/inc/librmnetctl.h
rmnetctl/src/librmnetctl.c
+18
-10
18 additions, 10 deletions
rmnetctl/src/librmnetctl.c
with
67 additions
and
24 deletions
rmnetctl/cli/rmnetcli.c
+
13
−
6
View file @
0f57f49c
...
...
@@ -125,8 +125,10 @@ static void rmnet_api_usage(void)
printf
(
_5TABS
" byte unsigned integer"
);
printf
(
_5TABS
" egress_flags
\n\n
"
);
printf
(
"rmnetcli setlidf <ingress_flags> Sets the ingress"
);
printf
(
_2TABS
" <dev_name> data format for a particular"
);
printf
(
_5TABS
" link. egress_flags is 4"
);
printf
(
_2TABS
" <tail_spacing> data format for a particular"
);
printf
(
_2TABS
" <dev_name> link. ingress_flags is 4"
);
printf
(
_5TABS
" byte unsigned integer."
);
printf
(
_5TABS
" tail_spacing is a one."
);
printf
(
_5TABS
" byte unsigned integer."
);
printf
(
_5TABS
" dev_name cannot be"
);
printf
(
_5TABS
" larger than 15."
);
...
...
@@ -299,10 +301,12 @@ static int rmnet_api_call(int argc, char *argv[])
}
}
else
if
(
!
strcmp
(
*
argv
,
"getlidf"
))
{
uint32_t
ingress_flags
;
return_code
=
rmnet_get_link_ingress_data_format
(
handle
,
argv
[
1
],
&
ingress_flags
,
&
error_number
);
uint8_t
tail_spacing
;
return_code
=
rmnet_get_link_ingress_data_format_tailspace
(
handle
,
argv
[
1
],
&
ingress_flags
,
&
tail_spacing
,
&
error_number
);
if
(
return_code
==
RMNETCTL_SUCCESS
)
{
printf
(
"ingress_flags is %u
\n
"
,
ingress_flags
);
printf
(
"tail_spacing is %u
\n
"
,
tail_spacing
);
}
}
else
if
(
!
strcmp
(
*
argv
,
"newvndprefix"
))
{
_RMNETCLI_CHECKNULL
(
argv
[
1
]);
...
...
@@ -328,8 +332,11 @@ static int rmnet_api_call(int argc, char *argv[])
_STRTOUI32
(
argv
[
1
]),
&
error_number
,
RMNETCTL_FREE_VND
);
}
else
if
(
!
strcmp
(
*
argv
,
"setlidf"
))
{
_RMNETCLI_CHECKNULL
(
argv
[
1
]);
return_code
=
rmnet_set_link_ingress_data_format
(
handle
,
_STRTOUI32
(
argv
[
1
]),
argv
[
2
],
&
error_number
);
_RMNETCLI_CHECKNULL
(
argv
[
2
]);
_RMNETCLI_CHECKNULL
(
argv
[
3
]);
return_code
=
rmnet_set_link_ingress_data_format_tailspace
(
handle
,
_STRTOUI32
(
argv
[
1
]),
_STRTOUI8
(
argv
[
2
]),
argv
[
3
],
&
error_number
);
}
else
if
(
!
strcmp
(
*
argv
,
"delvnctcflow"
))
{
_RMNETCLI_CHECKNULL
(
argv
[
1
]);
_RMNETCLI_CHECKNULL
(
argv
[
2
]);
...
...
This diff is collapsed.
Click to expand it.
rmnetctl/inc/librmnetctl.h
+
36
−
8
View file @
0f57f49c
...
...
@@ -238,6 +238,7 @@ int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl,
* @details Message type is RMNET_NETLINK_SET_LINK_INGRESS_DATA_FORMAT.
* @param *rmnetctl_hndl_t_val RmNet handle for the Netlink message
* @param ingress_flags Ingress flags from the device
* @param tail_spacing Tail spacing needed for the packet
* @param dev_name Device on which to set the ingress data format
* @param error_code Status code of this operation returned from the kernel
* @return RMNETCTL_SUCCESS if successful
...
...
@@ -246,10 +247,11 @@ int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl,
* Check error_code
* @return RMNETCTL_INVALID_ARG if invalid arguments were passed to the API
*/
int
rmnet_set_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
uint32_t
ingress_flags
,
const
char
*
dev_name
,
uint16_t
*
error_code
);
int
rmnet_set_link_ingress_data_format_tailspace
(
rmnetctl_hndl_t
*
hndl
,
uint32_t
ingress_flags
,
uint8_t
tail_spacing
,
const
char
*
dev_name
,
uint16_t
*
error_code
);
/*!
* @brief Public API to get the ingress data format for a particular link.
...
...
@@ -257,6 +259,7 @@ int rmnet_set_link_ingress_data_format(rmnetctl_hndl_t *hndl,
* @param *rmnetctl_hndl_t_val RmNet handle for the Netlink message
* @param dev_name Device on which to get the ingress data format
* @param ingress_flags Ingress flags from the device
* @param tail_spacing Tail spacing needed for the packet
* @param error_code Status code of this operation returned from the kernel
* @return RMNETCTL_SUCCESS if successful
* @return RMNETCTL_LIB_ERR if there was a library error. Check error_code
...
...
@@ -264,10 +267,35 @@ int rmnet_set_link_ingress_data_format(rmnetctl_hndl_t *hndl,
* Check error_code
* @return RMNETCTL_INVALID_ARG if invalid arguments were passed to the API
*/
int
rmnet_get_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
const
char
*
dev_name
,
uint32_t
*
ingress_flags
,
uint16_t
*
error_code
);
int
rmnet_get_link_ingress_data_format_tailspace
(
rmnetctl_hndl_t
*
hndl
,
const
char
*
dev_name
,
uint32_t
*
ingress_flags
,
uint8_t
*
tail_spacing
,
uint16_t
*
error_code
);
inline
int
rmnet_set_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
uint32_t
ingress_flags
,
const
char
*
dev_name
,
uint16_t
*
error_code
)
{
return
rmnet_set_link_ingress_data_format_tailspace
(
hndl
,
ingress_flags
,
0
,
dev_name
,
error_code
);
}
inline
int
rmnet_get_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
const
char
*
dev_name
,
uint32_t
*
ingress_flags
,
uint16_t
*
error_code
)
{
return
rmnet_get_link_ingress_data_format_tailspace
(
hndl
,
dev_name
,
ingress_flags
,
0
,
error_code
);
}
/*!
* @brief Public API to set the logical endpoint configuration for a
...
...
This diff is collapsed.
Click to expand it.
rmnetctl/src/librmnetctl.c
+
18
−
10
View file @
0f57f49c
...
...
@@ -501,10 +501,11 @@ int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl,
return
return_code
;
}
int
rmnet_set_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
uint32_t
ingress_flags
,
const
char
*
dev_name
,
uint16_t
*
error_code
)
{
int
rmnet_set_link_ingress_data_format_tailspace
(
rmnetctl_hndl_t
*
hndl
,
uint32_t
ingress_flags
,
uint8_t
tail_spacing
,
const
char
*
dev_name
,
uint16_t
*
error_code
)
{
struct
rmnet_nl_msg_s
request
,
response
;
int
str_len
=
-
1
,
return_code
=
RMNETCTL_LIB_ERR
;
do
{
...
...
@@ -523,6 +524,7 @@ int rmnet_set_link_ingress_data_format(rmnetctl_hndl_t *hndl,
if
(
_rmnetctl_check_len
(
str_len
,
error_code
)
!=
RMNETCTL_SUCCESS
)
break
;
request
.
data_format
.
flags
=
ingress_flags
;
request
.
data_format
.
tail_spacing
=
tail_spacing
;
if
((
*
error_code
=
rmnetctl_transact
(
hndl
,
&
request
,
&
response
))
!=
RMNETCTL_SUCCESS
)
...
...
@@ -536,14 +538,15 @@ int rmnet_set_link_ingress_data_format(rmnetctl_hndl_t *hndl,
return
return_code
;
}
int
rmnet_get_link_ingress_data_format
(
rmnetctl_hndl_t
*
hndl
,
const
char
*
dev_name
,
uint32_t
*
ingress_flags
,
uint16_t
*
error_code
)
{
int
rmnet_get_link_ingress_data_format_tailspace
(
rmnetctl_hndl_t
*
hndl
,
const
char
*
dev_name
,
uint32_t
*
ingress_flags
,
uint8_t
*
tail_spacing
,
uint16_t
*
error_code
)
{
struct
rmnet_nl_msg_s
request
,
response
;
int
str_len
=
-
1
,
return_code
=
RMNETCTL_LIB_ERR
;
do
{
if
((
!
hndl
)
||
(
!
ingress_flags
)
||
(
!
error_code
)
||
if
((
!
hndl
)
||
(
!
error_code
)
||
_rmnetctl_check_dev_name
(
dev_name
))
{
return_code
=
RMNETCTL_INVALID_ARG
;
break
;
...
...
@@ -565,7 +568,12 @@ int rmnet_get_link_ingress_data_format(rmnetctl_hndl_t *hndl,
if
(
_rmnetctl_check_data
(
response
.
crd
,
error_code
)
!=
RMNETCTL_SUCCESS
)
break
;
*
ingress_flags
=
response
.
data_format
.
flags
;
if
(
ingress_flags
)
*
ingress_flags
=
response
.
data_format
.
flags
;
if
(
tail_spacing
)
*
tail_spacing
=
response
.
data_format
.
tail_spacing
;
return_code
=
RMNETCTL_SUCCESS
;
}
while
(
0
);
return
return_code
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment