Commit c9976797 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (55 commits)
  ieee1394: sbp2: code formatting around work_struct stuff
  ieee1394: nodemgr: remove a kcalloc
  ieee1394: conditionally export ieee1394_bus_type
  ieee1394: Consolidate driver registering
  ieee1394: sbp2: convert from PCI DMA to generic DMA
  ieee1394: nodemgr: spaces to tabs
  ieee1394: nodemgr: fix deadlock in shutdown
  ieee1394: nodemgr: remove duplicate assignment
  sbp2: make 1bit bitfield unsigned
  ieee1394: schedule *_oui sysfs attributes for removal
  ieee1394: schedule unused symbol exports for removal
  ieee1394: dv1394: schedule for feature removal
  ieee1394: raw1394: defer feature removal of old isoch interface
  ieee1394: ohci1394: call PMac code in shutdown only for proper machines
  ieee1394: ohci1394: reformat PPC_PMAC platform code
  ieee1394: ohci1394: add PPC_PMAC platform code to driver probe
  ieee1394: sbp2: wrap two functions into one
  ieee1394: sbp2: update comment on things to do
  ieee1394: sbp2: use list_move_tail()
  ieee1394: sbp2: more concise names for types and variables
  ...
parents ea14fad0 ec9b7e10
...@@ -30,11 +30,39 @@ Who: Adrian Bunk <bunk@stusta.de> ...@@ -30,11 +30,39 @@ Who: Adrian Bunk <bunk@stusta.de>
--------------------------- ---------------------------
What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN
When: November 2006 When: June 2007
Why: Deprecated in favour of the new ioctl-based rawiso interface, which is Why: Deprecated in favour of the more efficient and robust rawiso interface.
more efficient. You should really be using libraw1394 for raw1394 Affected are applications which use the deprecated part of libraw1394
access anyway. (raw1394_iso_write, raw1394_start_iso_write, raw1394_start_iso_rcv,
Who: Jody McIntyre <scjody@modernduck.com> raw1394_stop_iso_rcv) or bypass libraw1394.
Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de>
---------------------------
What: dv1394 driver (CONFIG_IEEE1394_DV1394)
When: June 2007
Why: Replaced by raw1394 + userspace libraries, notably libiec61883. This
shift of application support has been indicated on www.linux1394.org
and developers' mailinglists for quite some time. Major applications
have been converted, with the exception of ffmpeg and hence xine.
Piped output of dvgrab2 is a partial equivalent to dv1394.
Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de>
---------------------------
What: ieee1394 core's unused exports (CONFIG_IEEE1394_EXPORT_FULL_API)
When: January 2007
Why: There are no projects known to use these exported symbols, except
dfg1394 (uses one symbol whose functionality is core-internal now).
Who: Stefan Richter <stefanr@s5r6.in-berlin.de>
---------------------------
What: ieee1394's *_oui sysfs attributes (CONFIG_IEEE1394_OUI_DB)
When: January 2007
Files: drivers/ieee1394/: oui.db, oui2c.sh
Why: big size, little value
Who: Stefan Richter <stefanr@s5r6.in-berlin.de>
--------------------------- ---------------------------
......
...@@ -36,7 +36,7 @@ config IEEE1394_VERBOSEDEBUG ...@@ -36,7 +36,7 @@ config IEEE1394_VERBOSEDEBUG
else says N. else says N.
config IEEE1394_OUI_DB config IEEE1394_OUI_DB
bool "OUI Database built-in" bool "OUI Database built-in (deprecated)"
depends on IEEE1394 depends on IEEE1394
help help
If you say Y here, then an OUI list (vendor unique ID's) will be If you say Y here, then an OUI list (vendor unique ID's) will be
...@@ -67,16 +67,11 @@ config IEEE1394_CONFIG_ROM_IP1394 ...@@ -67,16 +67,11 @@ config IEEE1394_CONFIG_ROM_IP1394
eth1394 option below. eth1394 option below.
config IEEE1394_EXPORT_FULL_API config IEEE1394_EXPORT_FULL_API
bool "Export all symbols of ieee1394's API" bool "Export all symbols of ieee1394's API (deprecated)"
depends on IEEE1394 depends on IEEE1394
default n default n
help help
Export all symbols of ieee1394's driver programming interface, even This option will be removed soon. Don't worry, say N.
those that are not currently used by the standard IEEE 1394 drivers.
This option does not affect the interface to userspace applications.
Say Y here if you want to compile externally developed drivers that
make extended use of ieee1394's API. It is otherwise safe to say N.
comment "Device Drivers" comment "Device Drivers"
depends on IEEE1394 depends on IEEE1394
...@@ -125,7 +120,7 @@ comment "SBP-2 support (for storage devices) requires SCSI" ...@@ -125,7 +120,7 @@ comment "SBP-2 support (for storage devices) requires SCSI"
config IEEE1394_SBP2 config IEEE1394_SBP2
tristate "SBP-2 support (Harddisks etc.)" tristate "SBP-2 support (Harddisks etc.)"
depends on IEEE1394 && SCSI && (PCI || BROKEN) depends on IEEE1394 && SCSI
help help
This option enables you to use SBP-2 devices connected to an IEEE This option enables you to use SBP-2 devices connected to an IEEE
1394 bus. SBP-2 devices include storage devices like harddisks and 1394 bus. SBP-2 devices include storage devices like harddisks and
...@@ -161,17 +156,12 @@ config IEEE1394_ETH1394 ...@@ -161,17 +156,12 @@ config IEEE1394_ETH1394
MCAP, therefore multicast support is significantly limited. MCAP, therefore multicast support is significantly limited.
config IEEE1394_DV1394 config IEEE1394_DV1394
tristate "OHCI-DV I/O support" tristate "OHCI-DV I/O support (deprecated)"
depends on IEEE1394 && IEEE1394_OHCI1394 depends on IEEE1394 && IEEE1394_OHCI1394
help help
This driver allows you to transmit and receive DV (digital video) The dv1394 driver will be removed from Linux in a future release.
streams on an OHCI-1394 card using a simple frame-oriented Its functionality is now provided by raw1394 together with libraries
interface. such as libiec61883.
The user-space API for dv1394 is documented in dv1394.h.
To compile this driver as a module, say M here: the
module will be called dv1394.
config IEEE1394_RAWIO config IEEE1394_RAWIO
tristate "Raw IEEE1394 I/O support" tristate "Raw IEEE1394 I/O support"
......
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
# #
ieee1394-objs := ieee1394_core.o ieee1394_transactions.o hosts.o \ ieee1394-objs := ieee1394_core.o ieee1394_transactions.o hosts.o \
highlevel.o csr.o nodemgr.o oui.o dma.o iso.o \ highlevel.o csr.o nodemgr.o dma.o iso.o \
csr1212.o config_roms.o csr1212.o config_roms.o
ifdef CONFIG_IEEE1394_OUI_DB
ieee1394-objs += oui.o
endif
obj-$(CONFIG_IEEE1394) += ieee1394.o obj-$(CONFIG_IEEE1394) += ieee1394.o
obj-$(CONFIG_IEEE1394_PCILYNX) += pcilynx.o obj-$(CONFIG_IEEE1394_PCILYNX) += pcilynx.o
......
...@@ -158,12 +158,10 @@ static void host_reset(struct hpsb_host *host) ...@@ -158,12 +158,10 @@ static void host_reset(struct hpsb_host *host)
*/ */
static inline void calculate_expire(struct csr_control *csr) static inline void calculate_expire(struct csr_control *csr)
{ {
unsigned long usecs = unsigned int usecs = (csr->split_timeout_hi & 7) * 1000000 +
(csr->split_timeout_hi & 0x07) * USEC_PER_SEC + (csr->split_timeout_lo >> 19) * 125;
(csr->split_timeout_lo >> 19) * 125L;
csr->expire = usecs_to_jiffies(usecs > 100000L ? usecs : 100000L);
csr->expire = usecs_to_jiffies(usecs > 100000 ? usecs : 100000);
HPSB_VERBOSE("CSR: setting expire to %lu, HZ=%u", csr->expire, HZ); HPSB_VERBOSE("CSR: setting expire to %lu, HZ=%u", csr->expire, HZ);
} }
......
...@@ -1536,28 +1536,21 @@ static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count ...@@ -1536,28 +1536,21 @@ static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count
static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct video_card *video; struct video_card *video = file_to_video_card(file);
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
lock_kernel();
video = file_to_video_card(file);
/* serialize this to prevent multi-threaded mayhem */ /* serialize this to prevent multi-threaded mayhem */
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK) {
if (!mutex_trylock(&video->mtx)) { if (!mutex_trylock(&video->mtx))
unlock_kernel();
return -EAGAIN; return -EAGAIN;
}
} else { } else {
if (mutex_lock_interruptible(&video->mtx)) { if (mutex_lock_interruptible(&video->mtx))
unlock_kernel();
return -ERESTARTSYS; return -ERESTARTSYS;
} }
}
switch(cmd) switch(cmd)
{ {
...@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
out: out:
mutex_unlock(&video->mtx); mutex_unlock(&video->mtx);
unlock_kernel();
return ret; return ret;
} }
...@@ -2188,12 +2180,8 @@ static struct ieee1394_device_id dv1394_id_table[] = { ...@@ -2188,12 +2180,8 @@ static struct ieee1394_device_id dv1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table); MODULE_DEVICE_TABLE(ieee1394, dv1394_id_table);
static struct hpsb_protocol_driver dv1394_driver = { static struct hpsb_protocol_driver dv1394_driver = {
.name = "DV/1394 Driver",
.id_table = dv1394_id_table,
.driver = {
.name = "dv1394", .name = "dv1394",
.bus = &ieee1394_bus_type, .id_table = dv1394_id_table,
},
}; };
...@@ -2587,6 +2575,10 @@ static int __init dv1394_init_module(void) ...@@ -2587,6 +2575,10 @@ static int __init dv1394_init_module(void)
{ {
int ret; int ret;
printk(KERN_WARNING
"WARNING: The dv1394 driver is unsupported and will be removed "
"from Linux soon. Use raw1394 instead.\n");
cdev_init(&dv1394_cdev, &dv1394_fops); cdev_init(&dv1394_cdev, &dv1394_fops);
dv1394_cdev.owner = THIS_MODULE; dv1394_cdev.owner = THIS_MODULE;
kobject_set_name(&dv1394_cdev.kobj, "dv1394"); kobject_set_name(&dv1394_cdev.kobj, "dv1394");
......
...@@ -474,12 +474,10 @@ static struct ieee1394_device_id eth1394_id_table[] = { ...@@ -474,12 +474,10 @@ static struct ieee1394_device_id eth1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, eth1394_id_table); MODULE_DEVICE_TABLE(ieee1394, eth1394_id_table);
static struct hpsb_protocol_driver eth1394_proto_driver = { static struct hpsb_protocol_driver eth1394_proto_driver = {
.name = "IPv4 over 1394 Driver", .name = ETH1394_DRIVER_NAME,
.id_table = eth1394_id_table, .id_table = eth1394_id_table,
.update = eth1394_update, .update = eth1394_update,
.driver = { .driver = {
.name = ETH1394_DRIVER_NAME,
.bus = &ieee1394_bus_type,
.probe = eth1394_probe, .probe = eth1394_probe,
.remove = eth1394_remove, .remove = eth1394_remove,
}, },
......
...@@ -24,7 +24,6 @@ struct hpsb_address_serve { ...@@ -24,7 +24,6 @@ struct hpsb_address_serve {
/* Only the following structures are of interest to actual highlevel drivers. */ /* Only the following structures are of interest to actual highlevel drivers. */
struct hpsb_highlevel { struct hpsb_highlevel {
struct module *owner;
const char *name; const char *name;
/* Any of the following pointers can legally be NULL, except for /* Any of the following pointers can legally be NULL, except for
......
...@@ -44,9 +44,10 @@ static void delayed_reset_bus(struct work_struct *work) ...@@ -44,9 +44,10 @@ static void delayed_reset_bus(struct work_struct *work)
CSR_SET_BUS_INFO_GENERATION(host->csr.rom, generation); CSR_SET_BUS_INFO_GENERATION(host->csr.rom, generation);
if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) { if (csr1212_generate_csr_image(host->csr.rom) != CSR1212_SUCCESS) {
/* CSR image creation failed, reset generation field and do not /* CSR image creation failed.
* issue a bus reset. */ * Reset generation field and do not issue a bus reset. */
CSR_SET_BUS_INFO_GENERATION(host->csr.rom, host->csr.generation); CSR_SET_BUS_INFO_GENERATION(host->csr.rom,
host->csr.generation);
return; return;
} }
...@@ -54,7 +55,8 @@ static void delayed_reset_bus(struct work_struct *work) ...@@ -54,7 +55,8 @@ static void delayed_reset_bus(struct work_struct *work)
host->update_config_rom = 0; host->update_config_rom = 0;
if (host->driver->set_hw_config_rom) if (host->driver->set_hw_config_rom)
host->driver->set_hw_config_rom(host, host->csr.rom->bus_info_data); host->driver->set_hw_config_rom(host,
host->csr.rom->bus_info_data);
host->csr.gen_timestamp[host->csr.generation] = jiffies; host->csr.gen_timestamp[host->csr.generation] = jiffies;
hpsb_reset_bus(host, SHORT_RESET); hpsb_reset_bus(host, SHORT_RESET);
...@@ -70,7 +72,8 @@ static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg) ...@@ -70,7 +72,8 @@ static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg)
return -1; return -1;
} }
static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg) static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command,
unsigned long arg)
{ {
return -1; return -1;
} }
...@@ -128,10 +131,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -128,10 +131,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
return NULL; return NULL;
h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h); h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h);
if (!h->csr.rom) { if (!h->csr.rom)
kfree(h); goto fail;
return NULL;
}
h->hostdata = h + 1; h->hostdata = h + 1;
h->driver = drv; h->driver = drv;
...@@ -151,16 +152,15 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -151,16 +152,15 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
init_timer(&h->timeout); init_timer(&h->timeout);
h->timeout.data = (unsigned long) h; h->timeout.data = (unsigned long) h;
h->timeout.function = abort_timedouts; h->timeout.function = abort_timedouts;
h->timeout_interval = HZ / 20; // 50ms by default h->timeout_interval = HZ / 20; /* 50ms, half of minimum SPLIT_TIMEOUT */
h->topology_map = h->csr.topology_map + 3; h->topology_map = h->csr.topology_map + 3;
h->speed_map = (u8 *)(h->csr.speed_map + 2); h->speed_map = (u8 *)(h->csr.speed_map + 2);
mutex_lock(&host_num_alloc); mutex_lock(&host_num_alloc);
while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb)) while (nodemgr_for_each_host(&hostnum, alloc_hostnum_cb))
hostnum++; hostnum++;
mutex_unlock(&host_num_alloc);
h->id = hostnum; h->id = hostnum;
memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device)); memcpy(&h->device, &nodemgr_dev_template_host, sizeof(h->device));
...@@ -171,13 +171,19 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -171,13 +171,19 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
h->class_dev.class = &hpsb_host_class; h->class_dev.class = &hpsb_host_class;
snprintf(h->class_dev.class_id, BUS_ID_SIZE, "fw-host%d", h->id); snprintf(h->class_dev.class_id, BUS_ID_SIZE, "fw-host%d", h->id);
device_register(&h->device); if (device_register(&h->device))
class_device_register(&h->class_dev); goto fail;
if (class_device_register(&h->class_dev)) {
device_unregister(&h->device);
goto fail;
}
get_device(&h->device); get_device(&h->device);
mutex_unlock(&host_num_alloc);
return h; return h;
fail:
kfree(h);
return NULL;
} }
int hpsb_add_host(struct hpsb_host *host) int hpsb_add_host(struct hpsb_host *host)
...@@ -229,7 +235,8 @@ int hpsb_update_config_rom_image(struct hpsb_host *host) ...@@ -229,7 +235,8 @@ int hpsb_update_config_rom_image(struct hpsb_host *host)
if (time_before(jiffies, host->csr.gen_timestamp[next_gen] + 60 * HZ)) if (time_before(jiffies, host->csr.gen_timestamp[next_gen] + 60 * HZ))
/* Wait 60 seconds from the last time this generation number was /* Wait 60 seconds from the last time this generation number was
* used. */ * used. */
reset_delay = (60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies; reset_delay =
(60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies;
else else
/* Wait 1 second in case some other code wants to change the /* Wait 1 second in case some other code wants to change the
* Config ROM in the near future. */ * Config ROM in the near future. */
......
...@@ -1237,10 +1237,10 @@ EXPORT_SYMBOL(highlevel_remove_host); ...@@ -1237,10 +1237,10 @@ EXPORT_SYMBOL(highlevel_remove_host);
/** nodemgr.c **/ /** nodemgr.c **/
EXPORT_SYMBOL(hpsb_node_fill_packet); EXPORT_SYMBOL(hpsb_node_fill_packet);
EXPORT_SYMBOL(hpsb_node_write); EXPORT_SYMBOL(hpsb_node_write);
EXPORT_SYMBOL(hpsb_register_protocol); EXPORT_SYMBOL(__hpsb_register_protocol);
EXPORT_SYMBOL(hpsb_unregister_protocol); EXPORT_SYMBOL(hpsb_unregister_protocol);
EXPORT_SYMBOL(ieee1394_bus_type);
#ifdef CONFIG_IEEE1394_EXPORT_FULL_API #ifdef CONFIG_IEEE1394_EXPORT_FULL_API
EXPORT_SYMBOL(ieee1394_bus_type);
EXPORT_SYMBOL(nodemgr_for_each_host); EXPORT_SYMBOL(nodemgr_for_each_host);
#endif #endif
......
This diff is collapsed.
...@@ -144,7 +144,12 @@ struct hpsb_protocol_driver { ...@@ -144,7 +144,12 @@ struct hpsb_protocol_driver {
struct device_driver driver; struct device_driver driver;
}; };
int hpsb_register_protocol(struct hpsb_protocol_driver *driver); int __hpsb_register_protocol(struct hpsb_protocol_driver *, struct module *);
static inline int hpsb_register_protocol(struct hpsb_protocol_driver *driver)
{
return __hpsb_register_protocol(driver, THIS_MODULE);
}
void hpsb_unregister_protocol(struct hpsb_protocol_driver *driver); void hpsb_unregister_protocol(struct hpsb_protocol_driver *driver);
static inline int hpsb_node_entry_valid(struct node_entry *ne) static inline int hpsb_node_entry_valid(struct node_entry *ne)
......
...@@ -468,7 +468,6 @@ static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg) ...@@ -468,7 +468,6 @@ static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg)
/* Global initialization */ /* Global initialization */
static void ohci_initialize(struct ti_ohci *ohci) static void ohci_initialize(struct ti_ohci *ohci)
{ {
char irq_buf[16];
quadlet_t buf; quadlet_t buf;
int num_ports, i; int num_ports, i;
...@@ -586,11 +585,10 @@ static void ohci_initialize(struct ti_ohci *ohci) ...@@ -586,11 +585,10 @@ static void ohci_initialize(struct ti_ohci *ohci)
reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable); reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable);
buf = reg_read(ohci, OHCI1394_Version); buf = reg_read(ohci, OHCI1394_Version);
sprintf (irq_buf, "%d", ohci->dev->irq); PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%d] "
PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s] "
"MMIO=[%llx-%llx] Max Packet=[%d] IR/IT contexts=[%d/%d]", "MMIO=[%llx-%llx] Max Packet=[%d] IR/IT contexts=[%d/%d]",
((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10), ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10),
((((buf) >> 4) & 0xf) + ((buf) & 0xf) * 10), irq_buf, ((((buf) >> 4) & 0xf) + ((buf) & 0xf) * 10), ohci->dev->irq,
(unsigned long long)pci_resource_start(ohci->dev, 0), (unsigned long long)pci_resource_start(ohci->dev, 0),
(unsigned long long)pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE - 1, (unsigned long long)pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE - 1,
ohci->max_packet_size, ohci->max_packet_size,
...@@ -3217,6 +3215,18 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev, ...@@ -3217,6 +3215,18 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
struct ti_ohci *ohci; /* shortcut to currently handled device */ struct ti_ohci *ohci; /* shortcut to currently handled device */
resource_size_t ohci_base; resource_size_t ohci_base;
#ifdef CONFIG_PPC_PMAC
/* Necessary on some machines if ohci1394 was loaded/ unloaded before */
if (machine_is(powermac)) {
struct device_node *ofn = pci_device_to_OF_node(dev);
if (ofn) {
pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 1);
pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
}
}
#endif /* CONFIG_PPC_PMAC */
if (pci_enable_device(dev)) if (pci_enable_device(dev))
FAIL(-ENXIO, "Failed to enable OHCI hardware"); FAIL(-ENXIO, "Failed to enable OHCI hardware");
pci_set_master(dev); pci_set_master(dev);
...@@ -3505,17 +3515,14 @@ static void ohci1394_pci_remove(struct pci_dev *pdev) ...@@ -3505,17 +3515,14 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
#endif #endif
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
/* On UniNorth, power down the cable and turn off the chip /* On UniNorth, power down the cable and turn off the chip clock
* clock when the module is removed to save power on * to save power on laptops */
* laptops. Turning it back ON is done by the arch code when if (machine_is(powermac)) {
* pci_enable_device() is called */ struct device_node* ofn = pci_device_to_OF_node(ohci->dev);
{
struct device_node* of_node;
of_node = pci_device_to_OF_node(ohci->dev); if (ofn) {
if (of_node) { pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0); pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, ofn, 0, 0);
pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, of_node, 0, 0);
} }
} }
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
...@@ -3529,57 +3536,100 @@ static void ohci1394_pci_remove(struct pci_dev *pdev) ...@@ -3529,57 +3536,100 @@ static void ohci1394_pci_remove(struct pci_dev *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int ohci1394_pci_resume (struct pci_dev *pdev) static int ohci1394_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{ {
/* PowerMac resume code comes first */ int err;
struct ti_ohci *ohci = pci_get_drvdata(pdev);
printk(KERN_INFO "%s does not fully support suspend and resume yet\n",
OHCI1394_DRIVER_NAME);
if (!ohci) {
printk(KERN_ERR "%s: tried to suspend nonexisting host\n",
OHCI1394_DRIVER_NAME);
return -ENXIO;
}
DBGMSG("suspend called");
/* Clear the async DMA contexts and stop using the controller */
hpsb_bus_reset(ohci->host);
/* See ohci1394_pci_remove() for comments on this sequence */
reg_write(ohci, OHCI1394_ConfigROMhdr, 0);
reg_write(ohci, OHCI1394_BusOptions,
(reg_read(ohci, OHCI1394_BusOptions) & 0x0000f007) |
0x00ff0000);
reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, 0xffffffff);
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 0xffffffff);
reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 0xffffffff);
reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 0xffffffff);
set_phy_reg(ohci, 4, ~0xc0 & get_phy_reg(ohci, 4));
reg_write(ohci, OHCI1394_LinkControlClear, 0xffffffff);
ohci_devctl(ohci->host, RESET_BUS, LONG_RESET_NO_FORCE_ROOT);
ohci_soft_reset(ohci);
err = pci_save_state(pdev);
if (err) {
PRINT(KERN_ERR, "pci_save_state failed with %d", err);
return err;
}
err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
if (err)
DBGMSG("pci_set_power_state failed with %d", err);
/* PowerMac suspend code comes last */
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
if (machine_is(powermac)) { if (machine_is(powermac)) {
struct device_node *of_node; struct device_node *ofn = pci_device_to_OF_node(pdev);
/* Re-enable 1394 */ if (ofn)
of_node = pci_device_to_OF_node (pdev); pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 0);
if (of_node)
pmac_call_feature (PMAC_FTR_1394_ENABLE, of_node, 0, 1);
} }
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
pci_set_power_state(pdev, PCI_D0); return 0;
pci_restore_state(pdev);
return pci_enable_device(pdev);
} }
static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state) static int ohci1394_pci_resume(struct pci_dev *pdev)
{ {
int err; int err;
struct ti_ohci *ohci = pci_get_drvdata(pdev);
printk(KERN_INFO "%s does not fully support suspend and resume yet\n", if (!ohci) {
printk(KERN_ERR "%s: tried to resume nonexisting host\n",
OHCI1394_DRIVER_NAME); OHCI1394_DRIVER_NAME);
return -ENXIO;
err = pci_save_state(pdev);
if (err) {
printk(KERN_ERR "%s: pci_save_state failed with %d\n",
OHCI1394_DRIVER_NAME, err);
return err;
} }
err = pci_set_power_state(pdev, pci_choose_state(pdev, state)); DBGMSG("resume called");
#ifdef OHCI1394_DEBUG
if (err)
printk(KERN_DEBUG "%s: pci_set_power_state failed with %d\n",
OHCI1394_DRIVER_NAME, err);
#endif /* OHCI1394_DEBUG */
/* PowerMac suspend code comes last */ /* PowerMac resume code comes first */
#ifdef CONFIG_PPC_PMAC #ifdef CONFIG_PPC_PMAC
if (machine_is(powermac)) { if (machine_is(powermac)) {
struct device_node *of_node; struct device_node *ofn = pci_device_to_OF_node(pdev);
/* Disable 1394 */ if (ofn)
of_node = pci_device_to_OF_node (pdev); pmac_call_feature(PMAC_FTR_1394_ENABLE, ofn, 0, 1);
if (of_node)
pmac_call_feature(PMAC_FTR_1394_ENABLE, of_node, 0, 0);
} }
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
err = pci_enable_device(pdev);
if (err) {
PRINT(KERN_ERR, "pci_enable_device failed with %d", err);
return err;
}
/* See ohci1394_pci_probe() for comments on this sequence */
ohci_soft_reset(ohci);
reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_LPS);
reg_write(ohci, OHCI1394_IntEventClear, 0xffffffff);
reg_write(ohci, OHCI1394_IntMaskClear, 0xffffffff);
mdelay(50);
ohci_initialize(ohci);
return 0; return 0;
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
......
...@@ -1428,10 +1428,9 @@ static int __devinit add_card(struct pci_dev *dev, ...@@ -1428,10 +1428,9 @@ static int __devinit add_card(struct pci_dev *dev,
struct i2c_algo_bit_data i2c_adapter_data; struct i2c_algo_bit_data i2c_adapter_data;
error = -ENOMEM; error = -ENOMEM;
i2c_ad = kmalloc(sizeof(*i2c_ad), GFP_KERNEL); i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL);
if (!i2c_ad) FAIL("failed to allocate I2C adapter memory"); if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
memcpy(i2c_ad, &bit_ops, sizeof(struct i2c_adapter));
i2c_adapter_data = bit_data; i2c_adapter_data = bit_data;
i2c_ad->algo_data = &i2c_adapter_data; i2c_ad->algo_data = &i2c_adapter_data;
i2c_adapter_data.data = lynx; i2c_adapter_data.data = lynx;
......
...@@ -27,12 +27,12 @@ struct file_info { ...@@ -27,12 +27,12 @@ struct file_info {
struct hpsb_host *host; struct hpsb_host *host;
struct list_head req_pending; struct list_head req_pending; /* protected by reqlists_lock */
struct list_head req_complete; struct list_head req_complete; /* protected by reqlists_lock */
spinlock_t reqlists_lock; spinlock_t reqlists_lock;
wait_queue_head_t wait_complete; wait_queue_head_t wait_complete;
struct list_head addr_list; struct list_head addr_list; /* protected by host_info_lock */
u8 __user *fcp_buffer; u8 __user *fcp_buffer;
...@@ -63,7 +63,7 @@ struct arm_addr { ...@@ -63,7 +63,7 @@ struct arm_addr {
u8 client_transactions; u8 client_transactions;
u64 recvb; u64 recvb;
u16 rec_length; u16 rec_length;
u8 *addr_space_buffer; /* accessed by read/write/lock */ u8 *addr_space_buffer; /* accessed by read/write/lock requests */
}; };
struct pending_request { struct pending_request {
...@@ -79,7 +79,7 @@ struct pending_request { ...@@ -79,7 +79,7 @@ struct pending_request {
struct host_info { struct host_info {
struct list_head list; struct list_head list;
struct hpsb_host *host; struct hpsb_host *host;
struct list_head file_info_list; struct list_head file_info_list; /* protected by host_info_lock */
}; };
#endif /* IEEE1394_RAW1394_PRIVATE_H */ #endif /* IEEE1394_RAW1394_PRIVATE_H */
...@@ -99,6 +99,21 @@ static struct hpsb_address_ops arm_ops = { ...@@ -99,6 +99,21 @@ static struct hpsb_address_ops arm_ops = {
static void queue_complete_cb(struct pending_request *req); static void queue_complete_cb(struct pending_request *req);
#include <asm/current.h>
static void print_old_iso_deprecation(void)
{
static pid_t p;
if (p == current->pid)
return;
p = current->pid;
printk(KERN_WARNING "raw1394: WARNING - Program \"%s\" uses unsupported"
" isochronous request types which will be removed in a next"
" kernel release\n", current->comm);
printk(KERN_WARNING "raw1394: Update your software to use libraw1394's"
" newer interface\n");
}
static struct pending_request *__alloc_pending_request(gfp_t flags) static struct pending_request *__alloc_pending_request(gfp_t flags)
{ {
struct pending_request *req; struct pending_request *req;
...@@ -2292,6 +2307,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req) ...@@ -2292,6 +2307,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req)
return sizeof(struct raw1394_request); return sizeof(struct raw1394_request);
case RAW1394_REQ_ISO_SEND: case RAW1394_REQ_ISO_SEND:
print_old_iso_deprecation();
return handle_iso_send(fi, req, node); return handle_iso_send(fi, req, node);
case RAW1394_REQ_ARM_REGISTER: case RAW1394_REQ_ARM_REGISTER:
...@@ -2310,6 +2326,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req) ...@@ -2310,6 +2326,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req)
return reset_notification(fi, req); return reset_notification(fi, req);
case RAW1394_REQ_ISO_LISTEN: case RAW1394_REQ_ISO_LISTEN:
print_old_iso_deprecation();
handle_iso_listen(fi, req); handle_iso_listen(fi, req);
return sizeof(struct raw1394_request); return sizeof(struct raw1394_request);
...@@ -2970,12 +2987,8 @@ static struct ieee1394_device_id raw1394_id_table[] = { ...@@ -2970,12 +2987,8 @@ static struct ieee1394_device_id raw1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table); MODULE_DEVICE_TABLE(ieee1394, raw1394_id_table);
static struct hpsb_protocol_driver raw1394_driver = { static struct hpsb_protocol_driver raw1394_driver = {
.name = "raw1394 Driver",
.id_table = raw1394_id_table,
.driver = {
.name = "raw1394", .name = "raw1394",
.bus = &ieee1394_bus_type, .id_table = raw1394_id_table,
},
}; };
/******************************************************************************/ /******************************************************************************/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -714,7 +714,7 @@ static inline unsigned video1394_buffer_state(struct dma_iso_ctx *d, ...@@ -714,7 +714,7 @@ static inline unsigned video1394_buffer_state(struct dma_iso_ctx *d,
return ret; return ret;
} }
static int __video1394_ioctl(struct file *file, static long video1394_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct file_ctx *ctx = (struct file_ctx *)file->private_data; struct file_ctx *ctx = (struct file_ctx *)file->private_data;
...@@ -884,13 +884,14 @@ static int __video1394_ioctl(struct file *file, ...@@ -884,13 +884,14 @@ static int __video1394_ioctl(struct file *file,
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
int next_prg; int next_prg;
if (copy_from_user(&v, argp, sizeof(v))) if (unlikely(copy_from_user(&v, argp, sizeof(v))))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
if (d == NULL) return -EFAULT; if (unlikely(d == NULL))
return -EFAULT;
if ((v.buffer<0) || (v.buffer>=d->num_desc - 1)) { if (unlikely((v.buffer<0) || (v.buffer>=d->num_desc - 1))) {
PRINT(KERN_ERR, ohci->host->id, PRINT(KERN_ERR, ohci->host->id,
"Buffer %d out of range",v.buffer); "Buffer %d out of range",v.buffer);
return -EINVAL; return -EINVAL;
...@@ -898,7 +899,7 @@ static int __video1394_ioctl(struct file *file, ...@@ -898,7 +899,7 @@ static int __video1394_ioctl(struct file *file,
spin_lock_irqsave(&d->lock,flags); spin_lock_irqsave(&d->lock,flags);
if (d->buffer_status[v.buffer]==VIDEO1394_BUFFER_QUEUED) { if (unlikely(d->buffer_status[v.buffer]==VIDEO1394_BUFFER_QUEUED)) {
PRINT(KERN_ERR, ohci->host->id, PRINT(KERN_ERR, ohci->host->id,
"Buffer %d is already used",v.buffer); "Buffer %d is already used",v.buffer);
spin_unlock_irqrestore(&d->lock,flags); spin_unlock_irqrestore(&d->lock,flags);
...@@ -949,13 +950,14 @@ static int __video1394_ioctl(struct file *file, ...@@ -949,13 +950,14 @@ static int __video1394_ioctl(struct file *file,
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
int i = 0; int i = 0;
if (copy_from_user(&v, argp, sizeof(v))) if (unlikely(copy_from_user(&v, argp, sizeof(v))))
return -EFAULT; return -EFAULT;
d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel); d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
if (d == NULL) return -EFAULT; if (unlikely(d == NULL))
return -EFAULT;
if ((v.buffer<0) || (v.buffer>d->num_desc - 1)) { if (unlikely((v.buffer<0) || (v.buffer>d->num_desc - 1))) {
PRINT(KERN_ERR, ohci->host->id, PRINT(KERN_ERR, ohci->host->id,
"Buffer %d out of range",v.buffer); "Buffer %d out of range",v.buffer);
return -EINVAL; return -EINVAL;
...@@ -1008,7 +1010,7 @@ static int __video1394_ioctl(struct file *file, ...@@ -1008,7 +1010,7 @@ static int __video1394_ioctl(struct file *file,
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
v.buffer=i; v.buffer=i;
if (copy_to_user(argp, &v, sizeof(v))) if (unlikely(copy_to_user(argp, &v, sizeof(v))))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -1156,15 +1158,6 @@ static int __video1394_ioctl(struct file *file, ...@@ -1156,15 +1158,6 @@ static int __video1394_ioctl(struct file *file,
} }
} }
static long video1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
int err;
lock_kernel();
err = __video1394_ioctl(file, cmd, arg);
unlock_kernel();
return err;
}
/* /*
* This maps the vmalloced and reserved buffer to user space. * This maps the vmalloced and reserved buffer to user space.
* *
...@@ -1177,17 +1170,14 @@ static long video1394_ioctl(struct file *file, unsigned int cmd, unsigned long a ...@@ -1177,17 +1170,14 @@ static long video1394_ioctl(struct file *file, unsigned int cmd, unsigned long a
static int video1394_mmap(struct file *file, struct vm_area_struct *vma) static int video1394_mmap(struct file *file, struct vm_area_struct *vma)
{ {
struct file_ctx *ctx = (struct file_ctx *)file->private_data; struct file_ctx *ctx = (struct file_ctx *)file->private_data;
int res = -EINVAL;
lock_kernel();
if (ctx->current_ctx == NULL) { if (ctx->current_ctx == NULL) {
PRINT(KERN_ERR, ctx->ohci->host->id, PRINT(KERN_ERR, ctx->ohci->host->id,
"Current iso context not set"); "Current iso context not set");
} else return -EINVAL;
res = dma_region_mmap(&ctx->current_ctx->dma, file, vma); }
unlock_kernel();
return res; return dma_region_mmap(&ctx->current_ctx->dma, file, vma);
} }
static unsigned int video1394_poll(struct file *file, poll_table *pt) static unsigned int video1394_poll(struct file *file, poll_table *pt)
...@@ -1198,14 +1188,12 @@ static unsigned int video1394_poll(struct file *file, poll_table *pt) ...@@ -1198,14 +1188,12 @@ static unsigned int video1394_poll(struct file *file, poll_table *pt)
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
int i; int i;
lock_kernel();
ctx = file->private_data; ctx = file->private_data;
d = ctx->current_ctx; d = ctx->current_ctx;
if (d == NULL) { if (d == NULL) {
PRINT(KERN_ERR, ctx->ohci->host->id, PRINT(KERN_ERR, ctx->ohci->host->id,
"Current iso context not set"); "Current iso context not set");
mask = POLLERR; return POLLERR;
goto done;
} }
poll_wait(file, &d->waitq, pt); poll_wait(file, &d->waitq, pt);
...@@ -1218,8 +1206,6 @@ static unsigned int video1394_poll(struct file *file, poll_table *pt) ...@@ -1218,8 +1206,6 @@ static unsigned int video1394_poll(struct file *file, poll_table *pt)
} }
} }
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
done:
unlock_kernel();
return mask; return mask;
} }
...@@ -1255,7 +1241,6 @@ static int video1394_release(struct inode *inode, struct file *file) ...@@ -1255,7 +1241,6 @@ static int video1394_release(struct inode *inode, struct file *file)
struct list_head *lh, *next; struct list_head *lh, *next;
u64 mask; u64 mask;
lock_kernel();
list_for_each_safe(lh, next, &ctx->context_list) { list_for_each_safe(lh, next, &ctx->context_list) {
struct dma_iso_ctx *d; struct dma_iso_ctx *d;
d = list_entry(lh, struct dma_iso_ctx, link); d = list_entry(lh, struct dma_iso_ctx, link);
...@@ -1276,7 +1261,6 @@ static int video1394_release(struct inode *inode, struct file *file) ...@@ -1276,7 +1261,6 @@ static int video1394_release(struct inode *inode, struct file *file)
kfree(ctx); kfree(ctx);
file->private_data = NULL; file->private_data = NULL;
unlock_kernel();
return 0; return 0;
} }
...@@ -1324,12 +1308,8 @@ static struct ieee1394_device_id video1394_id_table[] = { ...@@ -1324,12 +1308,8 @@ static struct ieee1394_device_id video1394_id_table[] = {
MODULE_DEVICE_TABLE(ieee1394, video1394_id_table); MODULE_DEVICE_TABLE(ieee1394, video1394_id_table);
static struct hpsb_protocol_driver video1394_driver = { static struct hpsb_protocol_driver video1394_driver = {
.name = "1394 Digital Camera Driver",
.id_table = video1394_id_table,
.driver = {
.name = VIDEO1394_DRIVER_NAME, .name = VIDEO1394_DRIVER_NAME,
.bus = &ieee1394_bus_type, .id_table = video1394_id_table,
},
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment