Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8103483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:33:38+00:00 2026-06-05T23:33:38+00:00

I need to read certain statistics from iw_statistics structure, here’s the code: struct net_device

  • 0

I need to read certain statistics from iw_statistics structure, here’s the code:

struct net_device *dev;
struct iw_statistics *wi_stats;
dev = first_net_device(&init_net);

  while (dev)
    {
      if (strncmp(dev->name , "wlan",4)==0 )
      {
         if (dev->wireless_handlers->get_wireless_stats(dev) !=NULL ) // <--- here's where the code crashes.
         {
        wi_stats = dev-wireless_handlers->get_wireless_stats(dev);
        printk(KERN_INFO "wi_stats = dev-wireless_handlers->get_wireless_stats(dev); worked!!! :D\n"); 
         }
       }

    }

I’m working on linux kernel 2.6.35 and I’m writing a kernel module. What am I doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:33:41+00:00Added an answer on June 5, 2026 at 11:33 pm

    Looks like wireless_handlers struct is Null … Just because a net device has it’s name field filled doesn’t mean it’s configured.

    This is where wireless_handlers gets set:

    #ifdef CONFIG_WIRELESS_EXT
        /* List of functions to handle Wireless Extensions (instead of ioctl).
         * See <net/iw_handler.h> for details. Jean II */
        const struct iw_handler_def *   wireless_handlers;
        /* Instance data managed by the core of Wireless Extensions. */
        struct iw_public_data * wireless_data;
    #endif
    

    You should check the value called CONFIG_WIRELESS_EXT if it’s not set , the wireless_handler struct is not set and thus you”ll be pointing to a Null and your module will get stuck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a kernel where I need to read certain statistics from iw_statistics structure,
I need to call this from the code behind if there is a certain
I need to read certain parts from a complex PDF. I searched the net
I need to be able to read a list of variables that follow certain
I need to read from a file and then break the line into 3
I need to read binary file from intranet http server and get it to
I need to read from a microsoft ODBC database and a postgres database at
I need to extract certain data from a file, but this file is formatted
I need to: 1. Monitor operations on certain drives/paths 2. Prevent read and/or write
I need to read data from an Excel sheet as part of a data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.