Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5761
b: refs/heads/master
c: 435d444
h: refs/heads/master
i:
  5759: 5803bb4
v: v3
  • Loading branch information
Linus Torvalds committed Aug 10, 2005
1 parent 27b8a3d commit e2670a6
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 484ae6bd9506488089c33784eff35b190fa80e03
refs/heads/master: 435d444a532af652ba8bdfd4db4424982bea2f69
4 changes: 2 additions & 2 deletions trunk/drivers/input/gameport/ns558.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ static int __init ns558_init(void)

static void __exit ns558_exit(void)
{
struct ns558 *ns558;
struct ns558 *ns558, *safe;

list_for_each_entry(ns558, &ns558_list, node) {
list_for_each_entry_safe(ns558, safe, &ns558_list, node) {
gameport_unregister_port(ns558->gameport);
release_region(ns558->io & ~(ns558->size - 1), ns558->size);
kfree(ns558);
Expand Down
20 changes: 4 additions & 16 deletions trunk/drivers/net/hamradio/6pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,19 @@ struct sixpack {

#define AX25_6PACK_HEADER_LEN 0

static void sp_start_tx_timer(struct sixpack *);
static void sixpack_decode(struct sixpack *, unsigned char[], int);
static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char);

/*
* perform the persistence/slottime algorithm for CSMA access. If the
* Perform the persistence/slottime algorithm for CSMA access. If the
* persistence check was successful, write the data to the serial driver.
* Note that in case of DAMA operation, the data is not sent here.
*/

static void sp_xmit_on_air(unsigned long channel)
{
struct sixpack *sp = (struct sixpack *) channel;
int actual;
int actual, when = sp->slottime;
static unsigned char random;

random = random * 17 + 41;
Expand All @@ -159,20 +158,10 @@ static void sp_xmit_on_air(unsigned long channel)
sp->tty->driver->write(sp->tty, &sp->led_state, 1);
sp->status2 = 0;
} else
sp_start_tx_timer(sp);
mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100);
}

/* ----> 6pack timer interrupt handler and friends. <---- */
static void sp_start_tx_timer(struct sixpack *sp)
{
int when = sp->slottime;

del_timer(&sp->tx_t);
sp->tx_t.data = (unsigned long) sp;
sp->tx_t.function = sp_xmit_on_air;
sp->tx_t.expires = jiffies + ((when + 1) * HZ) / 100;
add_timer(&sp->tx_t);
}

/* Encapsulate one AX.25 frame and stuff into a TTY queue. */
static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len)
Expand Down Expand Up @@ -243,8 +232,7 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len)
sp->xleft = count;
sp->xhead = sp->xbuff;
sp->status2 = count;
if (sp->duplex == 0)
sp_start_tx_timer(sp);
sp_xmit_on_air((unsigned long)sp);
}

return;
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/scsi/dpt_i2o.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
raptorFlag = TRUE;
}


if (pci_request_regions(pDev, "dpt_i2o")) {
PERROR("dpti: adpt_config_hba: pci request region failed\n");
return -EINVAL;
}
base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
if (!base_addr_virt) {
pci_release_regions(pDev);
PERROR("dpti: adpt_config_hba: io remap failed\n");
return -EINVAL;
}
Expand All @@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
if (!msg_addr_virt) {
PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n");
iounmap(base_addr_virt);
pci_release_regions(pDev);
return -EINVAL;
}
} else {
Expand All @@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
iounmap(msg_addr_virt);
}
iounmap(base_addr_virt);
pci_release_regions(pDev);
return -ENOMEM;
}
memset(pHba, 0, sizeof(adpt_hba));
Expand Down Expand Up @@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
up(&adpt_configuration_lock);

iounmap(pHba->base_addr_virt);
pci_release_regions(pHba->pDev);
if(pHba->msg_addr_virt != pHba->base_addr_virt){
iounmap(pHba->msg_addr_virt);
}
Expand Down
16 changes: 15 additions & 1 deletion trunk/drivers/scsi/scsi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,23 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
unsigned long flags;
const int size = sizeof(struct scsi_target)
+ shost->transportt->target_size;
struct scsi_target *starget = kmalloc(size, GFP_ATOMIC);
struct scsi_target *starget;
struct scsi_target *found_target;

/*
* Obtain the real parent from the transport. The transport
* is allowed to fail (no error) if there is nothing at that
* target id.
*/
if (shost->transportt->target_parent) {
spin_lock_irqsave(shost->host_lock, flags);
parent = shost->transportt->target_parent(shost, channel, id);
spin_unlock_irqrestore(shost->host_lock, flags);
if (!parent)
return NULL;
}

starget = kmalloc(size, GFP_KERNEL);
if (!starget) {
printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__);
return NULL;
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,23 @@ static int fc_rport_match(struct attribute_container *cont,
return &i->rport_attr_cont.ac == cont;
}


/*
* Must be called with shost->host_lock held
*/
static struct device *fc_target_parent(struct Scsi_Host *shost,
int channel, uint id)
{
struct fc_rport *rport;

list_for_each_entry(rport, &fc_host_rports(shost), peers)
if ((rport->channel == channel) &&
(rport->scsi_target_id == id))
return &rport->dev;

return NULL;
}

struct scsi_transport_template *
fc_attach_transport(struct fc_function_template *ft)
{
Expand Down Expand Up @@ -1057,6 +1074,8 @@ fc_attach_transport(struct fc_function_template *ft)

/* Transport uses the shost workq for scsi scanning */
i->t.create_work_queue = 1;

i->t.target_parent = fc_target_parent;

/*
* Setup SCSI Target Attributes.
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/scsi/scsi_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ struct scsi_transport_template {
struct transport_container target_attrs;
struct transport_container device_attrs;

/*
* If set, call target_parent prior to allocating a scsi_target,
* so we get the appropriate parent for the target. This function
* is required for transports like FC and iSCSI that do not put the
* scsi_target under scsi_host.
*/
struct device *(*target_parent)(struct Scsi_Host *, int, uint);

/* The size of the specific transport attribute structure (a
* space of this size will be left at the end of the
* scsi_* structure */
Expand Down

0 comments on commit e2670a6

Please sign in to comment.