Skip to main content

Common Download Code

1 reply [Last post]
mertl
Offline
Joined: 2010-06-22
Points: 0

What is the role of the RI Stack in Common Download in particular via SNMP? Currently Host::startDownload calls the Platform's mpeos_cdlStartDownload but little else is coded making it entirely a Platform activity.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
greg80303
Offline
Joined: 2008-07-03
Points: 0

The stack is only involved in so much as it is responsible for notifying the monitor application of a pending firmware upgrade. Unfortunately, I am not as familiar with the SNMP form of this upgrade signalling. But in the case of CableCARD, the host receives a "code_version_table" APDU from the card. This APDU contains a field that indicates whether the system must "download now" or if a "deferred download" is acceptable. If "download now" is signaled, the host will download and install the new firmware and reboot the system without notifying the stack. If deferred download is signaled, this is where the stack and MPEOS come into play.

- In $OCAPROOT/mpe/os/include/mpeos_cdl, you will see the porting APIs for common download. They are very simple. The stack must be able to a) register an event queue and b) trigger a deferred download to commence.

- When the platform detects a "deferred download" condition, it sends an event to the registered event queue. I know this is ugly, but it seems that there is no specific event ID for this event. The stack simply looks for any event to be sent between MPE_CDL_EVENT_MIN and MPE_CDL_EVENT_MAX (see $OCAPROOT/mpe/include/mpe_cdl.h).

- When the stack receives this event, it sends a org.ocap.system.event.DeferredDownloadEvent to a monapp that has registered interest in the event.

- If no monapp has registered interest in this event, the stack triggers the immediate download of the new firmware by calling mpe_cdlStartDownload().

- If a monapp has registered interest in this event, it is up to the monapp to call Host.codeDownload(), which will case the stack to call mpe_cdlStartDownload() to initiate the firmware upgrade process.

I don't know if the SNMP code upgrade mechanism supports both "download now" and "deferred download", but hopefully this is enough information to get you going.

G