Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192172
b: refs/heads/master
c: 3843ac3
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Walker committed May 12, 2010
1 parent acd8941 commit 08ceb66
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 42 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: 74df1d07ee01b7276cba64160ea6dfe195de008f
refs/heads/master: 3843ac3a5cd01824b5801209808e73fb9df7ee22
77 changes: 36 additions & 41 deletions trunk/arch/arm/mach-msm/smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ static struct shared_info smd_info = {
module_param_named(debug_mask, msm_smd_debug_mask,
int, S_IRUGO | S_IWUSR | S_IWGRP);

void *smem_item(unsigned id, unsigned *size);
static void smd_diag(void);

static unsigned last_heap_free = 0xffffffff;

static inline void notify_other_smsm(void)
Expand Down Expand Up @@ -147,44 +144,6 @@ LIST_HEAD(smd_ch_list_dsp);
static unsigned char smd_ch_allocated[64];
static struct work_struct probe_work;

static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type);

static void smd_channel_probe_worker(struct work_struct *work)
{
struct smd_alloc_elm *shared;
unsigned ctype;
unsigned type;
unsigned n;

shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
if (!shared) {
pr_err("smd: cannot find allocation table\n");
return;
}
for (n = 0; n < 64; n++) {
if (smd_ch_allocated[n])
continue;
if (!shared[n].ref_count)
continue;
if (!shared[n].name[0])
continue;
ctype = shared[n].ctype;
type = ctype & SMD_TYPE_MASK;

/* DAL channels are stream but neither the modem,
* nor the DSP correctly indicate this. Fixup manually.
*/
if (!memcmp(shared[n].name, "DAL", 3))
ctype = (ctype & (~SMD_KIND_MASK)) | SMD_KIND_STREAM;

type = shared[n].ctype & SMD_TYPE_MASK;
if ((type == SMD_TYPE_APPS_MODEM) ||
(type == SMD_TYPE_APPS_DSP))
if (!smd_alloc_channel(shared[n].name, shared[n].cid, ctype))
smd_ch_allocated[n] = 1;
}
}

/* how many bytes are available for reading */
static int smd_stream_read_avail(struct smd_channel *ch)
{
Expand Down Expand Up @@ -651,6 +610,42 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
return 0;
}

static void smd_channel_probe_worker(struct work_struct *work)
{
struct smd_alloc_elm *shared;
unsigned ctype;
unsigned type;
unsigned n;

shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
if (!shared) {
pr_err("smd: cannot find allocation table\n");
return;
}
for (n = 0; n < 64; n++) {
if (smd_ch_allocated[n])
continue;
if (!shared[n].ref_count)
continue;
if (!shared[n].name[0])
continue;
ctype = shared[n].ctype;
type = ctype & SMD_TYPE_MASK;

/* DAL channels are stream but neither the modem,
* nor the DSP correctly indicate this. Fixup manually.
*/
if (!memcmp(shared[n].name, "DAL", 3))
ctype = (ctype & (~SMD_KIND_MASK)) | SMD_KIND_STREAM;

type = shared[n].ctype & SMD_TYPE_MASK;
if ((type == SMD_TYPE_APPS_MODEM) ||
(type == SMD_TYPE_APPS_DSP))
if (!smd_alloc_channel(shared[n].name, shared[n].cid, ctype))
smd_ch_allocated[n] = 1;
}
}

static void do_nothing_notify(void *priv, unsigned flags)
{
}
Expand Down

0 comments on commit 08ceb66

Please sign in to comment.