Re: Advice on how to reverse-engineer register access to Motorola SM56 modem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 18/02/10 02:44, Rolf Eike Beer escribió:
Alex Villací­s Lasso wrote:
I have a Motorola SM56 PCI Winmodem card for which I want to write a
driver. The card is the one described here:
http://xmodem.org/chipsets/motorola/motorola_sm56pci.html . This card is
also mentioned at
http://www.linuxdriverproject.org/foswiki/bin/view/Main/DriversNeeded as
one of the cards for which Linux drivers are needed but not freely
available. I have tried googling around but I cannot find any reference
to a datasheet that tells me the usage of the hardware registers for
this card. Therefore I want to try the following:
- install a virtual machine package, either QEMU or Bochs
- install an OS for which a SM56 driver is available (I am thinking
Windows 98), and install said SM56 driver.
- modify the virtual machine code to add code to expose a virtual PCI
card with the same resources as the SM56 PCI card. This code will log
the register accesses performed on the virtual SM56, and then pass them
to the actual card. Currently the only resource the card exposes is a
256-byte MMIO region.
- with the real SM56 plugged in the host, write a userspace driver that
will be contacted by my code in the modified virtual machine, and
perform the actual register accesses as directed by the virtual machine

However, I am worried about DMA accesses. If the sequence of register
accesses happen to set up a DMA transfer, I might end up writing data
from the card to an arbitrary memory address on the host (which was
supposed to be valid in the guest) and crash my machine. Therefore I ask
the following:

Is there any measure I can take to guard against the scenario described
above?
Is there an alternative to find out how the card works, besides the
strategy shown above?
Is there any other caveat that I should be aware of?
Don't let the card be PCI master so it can't start PCI transfers on it's own.
I doubt a modem device will do DMA anyway ...
The thing is that this is not a full hardware modem (which would appear as a serial port). This is a winmodem, a device that merely collects or sends sound samples on the phone line, and that depends on a digital signal processing library executed by the CPU to transform the waveform into actual data. It is essentially a specialized sound card for the phone line. The examples I have seen in the kernel code so far (atiixp_modem.c, via82xx_modem.c) do use DMA. I see no reason to believe this device does not use DMA too.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux