Public bug reported:

Ubuntu 20.04.1 LTS
bcmwl-kernel-source_6.30.223.271


I believe the important part of the 
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log is below.

/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c: In function 
‘wl_reg_proc_entry’:
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:3376:58: 
error: passing argument 4 of ‘proc_create_data’ from incompatible pointe
r type [-Werror=incompatible-pointer-types]
 3376 |  if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) 
== NULL) {
      |                                                          ^~~~~~~~
      |                                                          |
      |                                                          const struct 
file_operations *
In file included from 
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c:38:
./include/linux/proc_fs.h:102:31: note: expected ‘const struct proc_ops *’ but 
argument is of type ‘const struct file_operations *’
  102 | extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
      |                               ^~~~~~~~~~~~~~~~


It looks like 
/var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/src/wl/sys/wl_linux.c uses the 
file_operations structure.

lines 3359-3381 from wl_linux.c

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
static const struct file_operations wl_fops = {
        .owner  = THIS_MODULE,
        .read   = wl_proc_read,
        .write  = wl_proc_write,
};
#endif

static int
wl_reg_proc_entry(wl_info_t *wl)
{
        char tmp[32];
        sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
        if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
                WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, 
tmp));
#else
        if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) 
== NULL) {
                WL_ERROR(("%s: proc_create_data %s failed\n", __FUNCTION__, 
tmp));
#endif
                ASSERT(0);
                return -1;
        }


However, it looks like proc_fs.h uses a different structure (proc_ops).

/usr/src/linux-headers-5.8.0-34-generic/include/linux/proc_fs.h
/usr/src/linux-hwe-5.8-headers-5.8.0-34/include/linux/proc_fs.h

kernel 5.8.0-34
proc_fs.h
lines 29-43 

struct proc_ops {
        unsigned int proc_flags;
        int     (*proc_open)(struct inode *, struct file *);
        ssize_t (*proc_read)(struct file *, char __user *, size_t, loff_t *);
        ssize_t (*proc_write)(struct file *, const char __user *, size_t, 
loff_t *);
        loff_t  (*proc_lseek)(struct file *, loff_t, int);
        int     (*proc_release)(struct inode *, struct file *);
        __poll_t (*proc_poll)(struct file *, struct poll_table_struct *);
        long    (*proc_ioctl)(struct file *, unsigned int, unsigned long);
#ifdef CONFIG_COMPAT
        long    (*proc_compat_ioctl)(struct file *, unsigned int, unsigned 
long);
#endif
        int     (*proc_mmap)(struct file *, struct vm_area_struct *);
        unsigned long (*proc_get_unmapped_area)(struct file *, unsigned long, 
unsigned long, unsigned long, unsigned long);
} __randomize_layout;

and lines 102-107

extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
                                               struct proc_dir_entry *,
                                               const struct proc_ops *,
                                               void *);

struct proc_dir_entry *proc_create(const char *name, umode_t mode,
struct proc_dir_entry *parent, const struct proc_ops *proc_ops);


Looking back at the linux 5.4.0-59 headers, proc_fs.h appears to use the 
file_operations structure.

/usr/src/linux-headers-5.4.0-59-generic/include/linux/proc_fs.h
/usr/src/linux-headers-5.4.0-59/include/linux/proc_fs.h

kernel 5.4.0-59
proc_fs.h
lines 44-49

extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
                                               struct proc_dir_entry *,
                                               const struct file_operations *,
                                               void *);

struct proc_dir_entry *proc_create(const char *name, umode_t mode,
struct proc_dir_entry *parent, const struct file_operations *proc_fops);


If this is where the problem lies, I am guessing it is better to try to fix the 
Broadcom package/ wl_linux.c than the Linux 5.8.0-34 headers?


The information above, was prompted by:

sudo apt-get install --reinstall bcmwl-kernel-source
...
Building initial module for 5.8.0-34-generic
ERROR: Cannot create report: [Errno 17] File exists: 
'/var/crash/bcmwl-kernel-source.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more 
information.
dpkg: error processing package bcmwl-kernel-source (--configure):
 installed bcmwl-kernel-source package post-installation script subprocess 
returned error exit status 10
Errors were encountered while processing:
 bcmwl-kernel-source
E: Sub-process /usr/bin/dpkg returned an error code (1)

** Affects: broadcom-sta (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: 5.8.0 6.30.223.271 bcmwl broadcom file operations ops proc

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1910618

Title:
  bcmwl 6.30.223.271+bdcom build fails with kernel 5.8.0-34

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/broadcom-sta/+bug/1910618/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to