LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-26-2022, 03:30 PM   #1
wearyhacker
LQ Newbie
 
Registered: Jan 2021
Posts: 9

Rep: Reputation: Disabled
Using udev to add a new MODULE_ALIAS to a driver


I am sure somewhere in the dim and distant past I was able to use modprobe and udev to associate a pci device with an existing driver. I have forgotten how.

I have a parallel port pci card. I want to associate it with the standard parport_pc driver, and the base address and irq parameters of the parport_pc driver.

I can use a modprobe alias to handle the parameters.

e.g.
alias parport_low_level parport_pc_addr
options parport_pc base_addr=0x999 irq=14

But that means I have manually load the driver.

I think I once used a udev rule for this. But I cannot remember how I did it. Maybe run modprobe from udev.

Anyone get any hints on how to go about it?
 
Old 01-26-2022, 04:33 PM   #2
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 274

Rep: Reputation: 89
Quote:
Originally Posted by wearyhacker View Post
I have a parallel port pci card. I want to associate it with the standard parport_pc driver, and the base address and irq parameters of the parport_pc driver.
parport_pc driver can handle PCI- & PCIe-parallelport cards if kernel is compiled with (code taken from .config for 5.15.13):
Code:
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
# CONFIG_PARPORT_SERIAL is not set
CONFIG_PARPORT_PC_FIFO=y
# CONFIG_PARPORT_PC_SUPERIO is not set
# CONFIG_PARPORT_AX88796 is not set
   CONFIG_PARPORT_1284=y
Hint: CONFIG_PARPORT_1284=y is only required if IEEE1284 devices e. g. many printers shall be connected to parallelport.

PCI- & PCIe-parallelport cards are configured by PnP. They get available addresses and IRQs. Why do you want to overwrite these ressources? PCI- & PCIe-parallelport cards cannot use addresses, IRQs and DMAs known for native parallelports e.g.:
  • LPT1 with I/O-base = 0x378; IRQ = 7; DMA = 3
  • LPT2 with I/O-base = 0x278; IRQ = 5; DMA = 1
ECP may not work properly because any DMA cannot assigned to PCI- & PCIe-parallelport cards neither by PnP nor manually.
 
Old 01-26-2022, 05:43 PM   #3
wearyhacker
LQ Newbie
 
Registered: Jan 2021
Posts: 9

Original Poster
Rep: Reputation: Disabled
My PCI card is is not in the MODULE_ALIAS definitions of the parport_pc module.
I would need to recompile it to put it in.

It uses a non standard io port base address.

I need to drive it as a ppd device not as a printer device.

My modprobe alias trick appears to work and the /proc/sys/dev parport tree as properly populated.

Do you know what kernel version the parport_pc pci support appears in?
 
Old 01-27-2022, 05:38 PM   #4
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 274

Rep: Reputation: 89
Quote:
Originally Posted by wearyhacker View Post
It uses a non standard io port base address.
What do you mean with "non standard io port base address"?
0x378, 0x278 and 0x3bc are used by parallel ports connected to ISA- or XT-bus only. I don't now anything about "standard I/O-base address" for PCI and PCIe x1 parallel port cards. PnP assigns ressources to these cards.
Here is dmesg output related to PCIe x1 parallel port card "Dawicontrol DC-9110 PCIe" (Chip: Oxford Semiconductor OXPCIe952 Parallel Port):
Code:
[    4.008833] PCI parallel port detected: 1415:c110, I/O at 0x9010(0x9000), IRQ 16
[    4.009383] parport0: PC-style at 0x9010 (0x9000), irq 16
[    4.009904] , using FIFO [PCSPP,TRISTATE,COMPAT,EPP,ECP]
Quote:
Originally Posted by wearyhacker View Post
Do you know what kernel version the parport_pc pci support appears in?
No.
I'm using both PCI and PCIe x1 parallel port cards since kernel 4.19.
 
Old 01-28-2022, 03:54 AM   #5
wearyhacker
LQ Newbie
 
Registered: Jan 2021
Posts: 9

Original Poster
Rep: Reputation: Disabled
I have this working now using the modprobe alias described in my initial post, and a UDEV rule to run modprobe on the aliased driver name.
 
  


Reply

Tags
modprobe, udev



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Driver core binding device to driver and Udev loading driver module-difference? ayyasprings Linux - Embedded & Single-board computer 0 01-23-2016 01:44 PM
[SOLVED] udev and dbus - using the notivy-send command in a script started by udev markush Slackware 2 10-14-2012 09:26 AM
UDEV: Unable to run a command line interface script after USB automount using udev mohamr2 Linux - Embedded & Single-board computer 8 08-16-2011 10:39 AM
current users - udev-128 - don't forget rc.udev.new! tobyl Slackware 3 10-08-2008 03:28 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration