-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xtrx.c: fix build error with kernel 6.10 #20
base: master
Are you sure you want to change the base?
Conversation
see kernel commit: torvalds/linux@1788cf6
Heya! Thanks for the patch! We tried to apply it in Kali Linux, unfortunately it fails. Logs below in case that helps to move this PR further:
|
Thank you for posting the build error! I tested my patch on the current version of Debian testing w/ the 6.10.9 kernel headers, and it worked for me. Admittedly, I'm not very experienced in kernel module development, so it's possible I'm missing something here, but based on the build errors, it seems something may be wrong in the way your build environment is passing
It would seem that the preprocessor is trying to build for an older kernel version, as it should be using the correct function definition for 6.4+ kernels. Notably, this code is untouched by this PR, which leads me to believe something is misconfigured in the build environment.
Could you kindly check the kernel version listed in
|
@WestonReed Thanks for your reply. Based on your comments, I realized that I applied your patch on a outdated version of the After I applied your changes on latest version of the package Sorry for the confusion I caused |
I just shipped your patch in:
|
Here's a copy of xtrx.c that builds with the new (and older) kernels: /*
#include <linux/module.h> #include "xtrx_defs.h" #define localparam static const uint32_t #define MAX_XTRX_DEVS 64 #define DRV_NAME "xtrx" #define DEVICE_NAME DRV_NAME #define XTRX_UART_LINE_GPS 0 #ifndef PCI_EXP_DEVCTL_READRQ_4096B /* Move out to extrnal CMD */ /* Serial virtual devices */ enum xtrx_uart_types { #define BUFS 32 #define BUF_SIZE_MIN 8192 #define UART_PORT_OPEN 1 struct xtrx_dmabuf_nfo { typedef enum xtrx_interrupt_type { enum xtrx_pwr_blocks { struct xtrx_dev {
}; static struct xtrx_dev xtrx_list = NULL; MODULE_AUTHOR("Sergey Kostanbaev [email protected]"); /* Some ARM platform pci_alloc_consistent() reports VA that can't be
static void xtrx_writel(struct xtrx_dev *dev, unsigned int off, unsigned int value) static unsigned int xtrx_readl(struct xtrx_dev *dev, unsigned int off) static int xtrx_power_op(struct xtrx_dev *dev, int on, unsigned mask)
} #define PORT_XTRX 0x03300330 /*
static struct xtrx_dev *xtrx_dev_from_uart_port(struct uart_port *port) static void xtrx_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
} static unsigned int xtrx_uart_get_mctrl(struct uart_port *port) static void xtrx_uart_stop_tx(struct uart_port *port) static void xtrx_uart_start_tx(struct uart_port *port) static void xtrx_uart_stop_rx(struct uart_port *port) static void xtrx_uart_enable_ms(struct uart_port *port) static void xtrx_uart_break_ctl(struct uart_port *port, int ctl) static void xtrx_uart_do_rx(struct uart_port port, unsigned fifo_used); static int xtrx_uart_startup(struct uart_port *port)
} static void xtrx_uart_shutdown(struct uart_port *port)
} static void xtrx_uart_set_termios(struct uart_port *port,
} static const char *xtrx_uart_type(struct uart_port *port) static int xtrx_uart_request_port(struct uart_port *port) static void xtrx_uart_release_port(struct uart_port *port) static void xtrx_uart_config_port(struct uart_port *port, int flags)
} static int xtrx_uart_verify_port(struct uart_port *port, void xtrx_uart_do_rx(struct uart_port port, unsigned fifo_used)
} static void xtrx_uart_do_tx(struct uart_port *port, unsigned fifo_used)
txq_empty: /* static struct uart_ops xtrx_uart_ops = { // TODO get rid of constant static struct uart_driver xtrx_uart_driver = { // TTY functions
} static void xtrx_uart_deinit(struct xtrx_dev* dev) // DMA functions
} static void xtrx_update_rxdma_len(struct xtrx_dev *d, struct xtrx_dmabuf_nfo *pbufs, unsigned len) static int xtrx_allocdma(struct xtrx_dev *d, struct xtrx_dmabuf_nfo *pbufs, unsigned config_off, unsigned buflen)
} static int xtrx_allocdma_tx(struct xtrx_dev *d, unsigned size)
} static int xtrx_allocdma_rx(struct xtrx_dev *d, unsigned size)
} static void xtrx_freedma_rx(struct xtrx_dev *d) static void xtrx_freedma_tx(struct xtrx_dev *d) // Interrupt routine functions static void xtrx_process_l_interrupts(struct xtrx_dev xtrxdev, uint32_t imask)
} static irqreturn_t xtrx_msi_irq_pps(int irq, void *data)
} static irqreturn_t xtrx_msi_irq_tx(int irq, void *data) static irqreturn_t xtrx_msi_irq_rx(int irq, void *data) static irqreturn_t xtrx_msi_irq_other(int irq, void *data)
} static irqreturn_t xtrx_irq_legacy(int irq, void *data)
} static irqreturn_t xtrx_msi_irq_single(int irq, void *data) static struct pps_source_info xtrx_pps_info = { static int xtrxfd_open(struct inode *inode, struct file *filp)
} static int xtrxfd_release(struct inode *inode, struct file *filp)
} static ssize_t xtrxfd_read(struct file *filp, char __user *buf, size_t count,
} static ssize_t xtrxfd_write(struct file *filp, const char __user *buf, size_t count, static unsigned int xtrxfd_poll(struct file *filp, poll_table *wait)
} // TODO more ioctls
} static void xtrxfd_vma_open(struct vm_area_struct *vma) static void xtrxfd_vma_close(struct vm_area_struct *vma) static struct vm_operations_struct xtrxfd_remap_vm_ops = { static int xtrxfd_mmap(struct file *filp, struct vm_area_struct *vma)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#ifdef VA_DMA_ADDR_FIXUP
} struct file_operations xtrx_fops = { static int xtrx_setup_cdev(struct xtrx_dev *xtrxdev)
} static int xtrx_probe(struct pci_dev pdev,
#ifdef VA_DMA_ADDR_FIXUP
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,11,0)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,11,0)
failed_cdev:
err_irq_2: err_disable_pdev:
}; static void xtrx_remove(struct pci_dev pdev)
} static struct pci_device_id xtrx_pci_table[] = { MODULE_DEVICE_TABLE(pci, xtrx_pci_table); static struct pci_driver xtrx_driver = { static int __init xtrx_init(void)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
failed_pci: static void __exit xtrx_cleanup(void)
} module_init(xtrx_init); |
see kernel commit: torvalds/linux@1788cf6
Fixes #19