Ubuntu This forum is for the discussion of Ubuntu Linux.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
04-28-2022, 12:54 PM
#1
LQ Newbie
Registered: Dec 2021
Posts: 9
Rep:
GCC Error
Hi, I'm trying to install some tools to make a WiFi card support monitor mode
https://github.com/radxa/rkwifibt/bl...ols/dhd_priv.c
To install them i was told to use the command
Code:
gcc dhd_priv.c -o dhd_priv
and that i would need gcc 7 to do so which i have installed.
However when running the command i just get loads of error's, can any give me any pointers please.
This is the start of the errors, sorry i cant post it all due to the limitation of characters per post.
Code:
root@rockpi-4b:~# gcc --version
gcc (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@rockpi-4b:~# ls
dhd_priv.c
root@rockpi-4b:~# gcc dhd_priv.c -o dhd_priv
dhd_priv.c:7:1: error: expected identifier or ‘(’ before ‘<’ token
<!DOCTYPE html>
^
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
<meta name="optimizely-datafile" content="{"groups": [], "environmentKey": "production", "rollouts": [], "typedAudiences": [], "projectId": "16737760170", "variables": [], "featureFlags": [], "experiments": [{"status": "Running", "audienceIds": [], "variations": [{"variables": [], "id": "20438636352", "key": "control"}, {"variables": [], "id": "20484957397", "key": "treatment"}], "id": "20479227424", "key": "growth_ghec_onboarding_experience", "layerId": "20467848595", "trafficAllocation": [{"entityId": "20484957397", "endOfRange": 1000}, {"entityId": "20484957397", "endOfRange": 3000}, {"entityId": "20484957397", "endOfRange": 5000}, {"entityId": "20484957397", "endOfRange": 6000}, {"entityId": "20484957397", "endOfRange": 8000}, {"entityId": "20484957397", "endOfRange": 10000}], "forcedVariations": {"85e2238ce2b9074907d7a3d91d6feeae": "control"}}, {"status": "Running", "audienceIds": [], "variations": [{"variables": [], "id": "20667381018", "key": "control"}, {"variables": [], "id": "20680930759", "key": "treatment"}], "id": "20652570897", "key": "project_genesis", "layerId": "20672300363", "trafficAllocation": [{"entityId": "20667381018", "endOfRange": 5000}, {"entityId": "20680930759", "endOfRange": 10000}], "forcedVariations": {"83356e17066d336d1803024138ecb683": "treatment", "18e31c8a9b2271332466133162a4aa0d": "treatment", "10f8ab3fbc5ebe989a36a05f79d48f32": "treatment", "1686089f6d540cd2deeaec60ee43ecf7": "treatment"}}, {"status": "Running", "audienceIds": [], "variations": [{"variables": [], "id": "21427950901", "key": "control"}, {"variables": [], "id": "21429710665", "key": "beginner"}, {"variables": [], "id": "21437291543", "key": "upstart"}], "id": "21445030708", "key": "_259_zero_user_dashboard", "layerId": "21434011841", "trafficAllocation": [{"entityId": "21427950901", "endOfRange": 3334}, {"entityId": "21437291543", "endOfRange": 5000}, {"entityId": "21429710665", "endOfRange": 8333}, {"entityId": "21437291543", "endOfRange": 10000}], "forcedVariations": {"3c64268131793aa297119a343c19e345": "beginner", "95b24126db31ea8693c0fe5ea9f53b65": "beginner", "086e2abe64e9101112af53b95d2d90b9": "upstart", "bae688df9d297afac98e2d254e912ada": "control", "6c2cfda7c41396fcc31a4db759a42b94": "beginner", "16ed2b4ff7de02663b7c606309695916": "control", "1971768911.1635962195": "beginner", "830bf802470ec6c9c5800c99d8e57445": "beginner"}}], "version": "4", "audiences": [{"conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", "id": "$opt_dummy_audience", "name": "Optimizely-Generated Audience for Backwards Compatibility"}], "anonymizeIP": true, "sdkKey": "WTc6awnGuYDdG98CYRban", "attributes": [{"id": "16822470375", "key": "user_id"}, {"id": "17143601254", "key": "spammy"}, {"id": "18175660309", "key": "organization_plan"}, {"id": "18813001570", "key": "is_logged_in"}, {"id": "19073851829", "key": "geo"}, {"id": "20175462351", "key": "requestedCurrency"}, {"id": "20785470195", "key": "country_code"}], "botFiltering": false, "accountId": "16737760170", "events": [{"experimentIds": [], "id": "17911811441", "key": "hydro_click.dashboard.teacher_toolbox_cta"}, {"experimentIds": [], "id": "18124116703", "key": "submit.organizations.complete_sign_up"}, {"experimentIds": [], "id": "18145892387", "key": "no_metric.tracked_outside_of_optimizely"}, {"experimentIds": [], "id": "18178755568", "key": "click.org_onboarding_checklist.add_repo"}, {"experimentIds": [], "id": "18180553241", "key": "submit.repository_imports.create"}, {"experimentIds": [], "id": "18186103728", "key": "click.help.learn_more_about_repository_creation"}, {"experimentIds": [], "id": "18188530140", "key": "test_event"}, {"experimentIds": [], "id": "18191963644", "key": "click.empty_org_repo_cta.transfer_repository"}, {"experimentIds": [], "id": "18195612788", "key": "click.empty_org_repo_cta.import_repository"}, {"experimentIds": [], "id": "18210945499", "key": "click.org_onboarding_checklist.invite_members"}, {"experimentIds": [], "id": "18211063248", "key": "click.empty_org_repo_cta.create_repository"}, {"experimentIds": [], "id": "18215721889", "key": "click.org_onboarding_checklist.update_profile"}, {"experimentIds": [], "id": "18224360785", "key": "click.org_onboarding_checklist.dismiss"}, {"experimentIds": [], "id": "18234832286", "key": "submit.organization_activation.complete"}, {"experimentIds": [], "id": "18252392383", "key": "submit.org_repository.create"}, {"experimentIds": [], "id": "18257551537", "key": "submit.org_member_invitation.create"}, {"experimentIds": [], "id": "18259522260", "key": "submit.organization_profile.update"}, {"experimentIds": [], "id": "18564603625", "key": "view.classroom_select_organization"}, {"experimentIds": [], "id": "18568612016", "key": "click.classroom_sign_in_click"}, {"experimentIds": [], "id": "18572592540", "key": "view.classroom_name"}, {"experimentIds": [], "id": "18574203855", "key": "click.classroom_create_organization"}, {"experimentIds": [], "id": "18582053415", "key": "click.classroom_select_organization"}, {"experimentIds": [], "id": "18589463420", "key": "click.classroom_create_classroom"}, {"experimentIds": [], "id": "18591323364", "key": "click.classroom_create_first_classroom"}, {"experimentIds": [], "id": "18591652321", "key": "click.classroom_grant_access"}, {"experimentIds": [], "id": "18607131425", "key": "view.classroom_creation"}, {"experimentIds": ["20479227424"], "id": "18831680583", "key": "upgrade_account_plan"}, {"experimentIds": [], "id": "19064064515", "key": "click.signup"}, {"experimentIds": [], "id": "19075373687", "key": "click.view_account_billing_page"}, {"experimentIds": [], "id": "19077355841", "key": "click.dismiss_signup_prompt"}, {"experimentIds": [], "id": "19079713938", "key": "click.contact_sales"}, {"experimentIds": [], "id": "19120963070", "key": "click.compare_account_plans"}, {"experimentIds": [], "id": "19151690317", "key": "click.upgrade_account_cta"}, {"experimentIds": [], "id": "19424193129", "key": "click.open_account_switcher"}, {"experimentIds": [], "id": "19520330825", "key": "click.visit_account_profile"}, {"experimentIds": [], "id": "19540970635", "key": "click.switch_account_context"}, {"experimentIds": [], "id": "19730198868", "key": "submit.homepage_signup"}, {"experimentIds": [], "id": "19820830627", "key": "click.homepage_signup"}, {"experimentIds": [], "id": "19988571001", "key": "click.create_enterprise_trial"}, {"experimentIds": [], "id": "20036538294", "key": "click.create_organization_team"}, {"experimentIds": [], "id": "20040653299", "key": "click.input_enterprise_trial_form"}, {"experimentIds": [], "id": "20062030003", "key": "click.continue_with_team"}, {"experimentIds": [], "id": "20068947153", "key": "click.create_organization_free"}, {"experimentIds": [], "id": "20086636658", "key": "click.signup_continue.username"}, {"experimentIds": [], "id": "20091648988", "key": "click.signup_continue.create_account"}, {"experimentIds": [], "id": "20103637615", "key": "click.signup_continue.email"}, {"experimentIds": [], "id": "20111574253", "key": "click.signup_continue.password"}, {"experimentIds": [], "id": "20120044111", "key": "view.pricing_page"}, {"experimentIds": [], "id": "20152062109", "key": "submit.create_account"}, {"experimentIds": [], "id": "20165800992", "key": "submit.upgrade_payment_form"}, {"experimentIds": [], "id": "20171520319", "key": "submit.create_organization"}, {"experimentIds": [], "id": "20222645674", "key": "click.recommended_plan_in_signup.discuss_your_needs"}, {"experimentIds": [], "id": "20227443657", "key": "submit.verify_primary_user_email"}, {"experimentIds": [], "id": "20234607160", "key": "click.recommended_plan_in_signup.try_enterprise"}, {"experimentIds": [], "id": "20238175784", "key": "click.recommended_plan_in_signup.team"}, {"experimentIds": [], "id": "20239847212", "key": "click.recommended_plan_in_signup.continue_free"}, {"experimentIds": [], "id": "20251097193", "key": "recommended_plan"}, {"experimentIds": [], "id": "20438619534", "key": "click.pricing_calculator.1_member"}, {"experimentIds": [], "id": "20456699683", "key": "click.pricing_calculator.15_members"}, {"experimentIds": [], "id": "20467868331", "key": "click.pricing_calculator.10_members"}, {"experimentIds": [], "id": "20476267432", "key": "click.trial_days_remaining"}, {"experimentIds": ["20479227424"], "id": "20476357660", "key": "click.discover_feature"}, {"experimentIds": [], "id": "20479287901", "key": "click.pricing_calculator.custom_members"}, {"experimentIds": [], "id": "20481107083", "key": "click.recommended_plan_in_signup.apply_teacher_benefits"}, {"experimentIds": [], "id": "20483089392", "key": "click.pricing_calculator.5_members"}, {"experimentIds": ["20479227424", "20652570897"], "id": "20484283944", "key": "click.onboarding_task"}, {"experimentIds": [], "id": "20484996281", "key": "click.recommended_plan_in_signup.apply_student_benefits"}, {"experimentIds": ["20479227424"], "id": "20486713726", "key": "click.onboarding_task_breadcrumb"}, {"experimentIds": ["20479227424"], "id": "20490791319", "key": "click.upgrade_to_enterprise"}, {"experimentIds": ["20479227424"], "id": "20491786766", "key": "click.talk_to_us"}, {"experimentIds": ["20479227424"], "id": "20494144087", "key": "click.dismiss_enterprise_trial"}, {"experimentIds": ["20479227424", "20652570897"], "id": "20499722759", "key": "completed_all_tasks"}, {"experimentIds": ["20479227424", "20652570897"], "id": "20500710104", "key": "completed_onboarding_tasks"}, {"experimentIds": ["20479227424"], "id": "20513160672", "key": "click.read_doc"}, {"experimentIds": ["20652570897"], "id": "20516196762", "key": "actions_enabled"}, {"experimentIds": ["20479227424"], "id": "20518980986", "key": "click.dismiss_trial_banner"}, {"experimentIds": [], "id": "20535446721", "key": "click.issue_actions_prompt.dismiss_prompt"}, {"experimentIds": [], "id": "20557002247", "key": "click.issue_actions_prompt.setup_workflow"}, {"experimentIds": [], "id": "20595070227", "key": "click.pull_request_setup_workflow"}, {"experimentIds": [], "id": "20626600314", "key": "click.seats_input"}, {"experimentIds": [], "id": "20642310305", "key": "click.decrease_seats_number"}, {"experimentIds": [], "id": "20662990045", "key": "click.increase_seats_number"}, {"experimentIds": [], "id": "20679620969", "key": "click.public_product_roadmap"}, {"experimentIds": ["20479227424"], "id": "20761240940", "key": "click.dismiss_survey_banner"}, {"experimentIds": ["20479227424"], "id": "20767210721", "key": "click.take_survey"}, {"experimentIds": ["20652570897"], "id": "20795281201", "key": "click.archive_list"}, {"experimentIds": [], "id": "20966790249", "key": "contact_sales.submit"}, {"experimentIds": [], "id": "20996500333", "key": "contact_sales.existing_customer"}, {"experimentIds": [], "id": "20996890162", "key": "contact_sales.blank_message_field"}, {"experimentIds": [], "id": "21000470317", "key": "contact_sales.personal_email"}, {"experimentIds": [], "id": "21002790172", "key": "contact_sales.blank_phone_field"}, {"experimentIds": ["21445030708"], "id": "21354412592", "key": "click.dismiss_create_readme"}, {"experimentIds": ["21445030708"], "id": "21366102546", "key": "click.dismiss_zero_user_content"}, {"experimentIds": [], "id": "21370252505", "key": "account_did_downgrade"}, {"experimentIds": ["21445030708"], "id": "21370840408", "key": "click.cta_create_readme"}, {"experimentIds": ["21445030708"], "id": "21375451068", "key": "click.cta_create_new_repository"}, {"experimentIds": ["21445030708"], "id": "21385390948", "key": "click.zero_user_content"}], "revision": "1169"}" />
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:26:46: warning: unknown escape sequence: '\&'
dhd_priv.c:61:40: error: stray ‘\302’ in program
<title>rkwifibt/dhd_priv.c at master ▒▒ radxa/rkwifibt · GitHub</title>
^
dhd_priv.c:61:41: error: stray ‘\267’ in program
<title>rkwifibt/dhd_priv.c at master ▒▒ radxa/rkwifibt · GitHub</title>
^
dhd_priv.c:61:58: error: stray ‘\302’ in program
<title>rkwifibt/dhd_priv.c at master · radxa/rkwifibt ▒▒ GitHub</title>
^
dhd_priv.c:61:59: error: stray ‘\267’ in program
<title>rkwifibt/dhd_priv.c at master · radxa/rkwifibt ▒▒ GitHub</title>
^
dhd_priv.c:185:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
</a>
04-28-2022, 01:07 PM
#2
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830
what you have downloaded is not a c file, but a html.
04-28-2022, 01:47 PM
#3
LQ Newbie
Registered: Dec 2021
Posts: 9
Original Poster
Rep:
OMG i'm such an idiot. Thanks for pointing that out.
04-28-2022, 01:56 PM
#4
LQ Newbie
Registered: Dec 2021
Posts: 9
Original Poster
Rep:
OK, so using the correct file now....different error message
Quote:
root@rockpi-4b:~# ls
dhd_priv.c
root@rockpi-4b:~# gcc dhd_priv.c -o dhd_priv
dhd_priv.c: In function ‘main’:
dhd_priv.c:15:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
#define TAG "dhd_priv: "
^
dhd_priv.c:85:14: note: in expansion of macro ‘TAG’
DHD_PRINTF(TAG “buf = %s, len = %d, ret = %d\n”, buf, strlen(buf), ret);
^~~
dhd_priv.c:85:36: note: format string is defined here
DHD_PRINTF(TAG “buf = %s, len = %d, ret = %d\n”, buf, strlen(buf), ret);
~^
%ld
root@rockpi-4b:~# gcc --version
gcc (Ubuntu/Linaro 7.5.0-6ubuntu2) 7.5.0
Copyright © 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
04-29-2022, 12:07 AM
#5
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830
that is not an error message, just a warning. I think you can check your app is ready to use
04-29-2022, 07:02 AM
#6
LQ Newbie
Registered: Dec 2021
Posts: 9
Original Poster
Rep:
Thanks for the assistance, much appreciated
when i run the next command i get the following
Quote:
root@rockpi-4b:~# sudo ./dhd_priv channel 6
dhd_priv: Version = 1.2
argv: ./dhd_priv channel 6
dhd_priv: failed to issue private commands -1
root@rockpi-4b:~#
04-29-2022, 09:31 AM
#7
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Quote:
dhd_priv: failed to issue private commands -1
Line 83
Code:
if ((ret = ioctl(ioctl_sock, SIOCDEVPRIVATE + 1, &ifr)) < 0) {
DHD_PRINTF(TAG "failed to issue private commands %d\n", ret);
} else {
DHD_PRINTF(TAG "buf = %s, len = %d, ret = %d\n", buf, strlen(buf), ret);
}
Code:
//Line 43
int ret = 0;
//Line 44
int ioctl_sock;
//Line 68
ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0);
if (ioctl_sock < 0) {
DHD_PRINTF(TAG "socket(PF_INET,SOCK_DGRAM)\n");
return -1;
}
//Line 83
SIOCDEVPRIVATE
I don't see any notes on this at all
https://github.com/radxa/rkwifibt
https://github.com/radxa/rkwifibt/commits/master
You are going to have to understand what this is doing, where the inputs come from, and why.
Where did you get the notes from to compile and run this? If you want help, you are going to have to give a lot more info.
04-29-2022, 09:44 AM
#8
LQ Newbie
Registered: Dec 2021
Posts: 9
Original Poster
Rep:
Hi @Teckk, thanks for the info.
The problem i have is missing info unfortunately so all i have to go by is error messages.
To back track a little, i have a Rockpi 4B board which has onboard WiFi running Armbian 22.05 which is a version of Ubuntu.
The onboard WiFi is supposed to support monitor mode which is what this code is supposed to enable.
The only instruction i have to follow is from this page - [URL="https://wiki.radxa.com/Rockpi4/dev/monitor-mode"]https://wiki.radxa.com/Rockpi4/dev/monitor-mode[/URL
However the link provided is dead so the support team there told me to use the Github link -
https://github.com/radxa/rkwifibt/bl...ols/dhd_priv.c
Originally when i tried to compile the C code i got an error so was advised to use gcc 7 which i have done.
That's pretty much where i have managed to get to, once compiled i get the messages mentioned above and then if i continue ( based on the suggestion of them being warnings ) i get the other error previously mentioned.
As you may have guessed i'm no Linux Guru so not sure really where to go next, however one thing that does bug me with the C Code is there is several mentions of Android and nothing that suggests what interface i will use for the monitor mode, i.e. wlan0
I'm 100% sure if this code is even for Ubuntu.
04-29-2022, 10:10 AM
#9
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830
https://www.oreilly.com/library/view...1/ch14s11.html
Quote:
The ioctl implementation for sockets recognizes 16 commands as private to the interface: SIOCDEVPRIVATE through SIOCDEVPRIVATE+15.
All times are GMT -5. The time now is 09:28 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News